Jan 22, 2013

Change the Url Arguments without Reloading the page


Change the Url Arguments without Reloading the page  

It was always a messy thing to deal with urls for different pages or resources on a website And the only method we got was location.hash  AJAX applications to get back button and bookmarking support, and libraries like jQuery BBQ from Ben Alman made dealing with it cross browser a cinch.  Now, with HTML5 coming of age, there is a new feature that aims to replace the use of location.hash with a better solution: pushState.  Over on the Spoiled Milk blog, Jamie Appleseed describes the API as “a way to change the URL displayed in the browser through JavaScript without reloading the page.”  It works on the history object like this:
window.history.pushState(data, "Title", "/new-url");
The last argument is the new URL.  For security reasons you can only change the path of the URL, not the domain itself.  The second argument is a description of the new state.  And the first argument is some data that you might want to store along with the state.
In order to support the back and forward buttons you must be notified when they are clicked.  You can do that using the window.onpopstateevent.  This event gives you access to the state data that you passed topushState earlier.  Of course, you can manually go back and forward with the standard history functions.
Currently, pushState has support from the latest versions of Safari and Chrome, and Firefox 4 will be supporting it as well.  It is worth noting that Flickr is already using the API in their new layout.  I think that this is really the correct way to be dealing with history management in JavaScript applications since it changes the real URL instead of just the hash.  I’m very excited to see libraries like jQuery BBQ start to support this feature with fallback to the old hash trick.
If you’d like to read a more in depth overview of these new features, you should check out the aforementioned blog post by Jamie Appleseed.  If reading specs is your thing, you can check out the relevant document

Jan 10, 2013

Social Media Sharing Links

Creating custom social sharing widgets for your website

Ever bother to make a sharing widget, here is the required info, u need to know to make a global sharing platform. what you need to do is to simply create a link ( < a href="given url here >social media</a>" ) Set its URL to one of the provided below.


1. Twitter.

URL :    https://twitter.com/intent/tweet?
ARGS : 
text = Hello this is a message length must not exceed 50 chars 
related = pulsepad
url = the intended url. 

2. Facebook.

for open type posting

http://www.facebook.com/sharer.php?u=http%3A%2F%2Fpinkink.brightpinkstudio.com&t=Hellothere

 if u have an application then be precise and use this


  https://www.facebook.com/dialog/feed?
  app_id=458358780877780&
  link=https://developers.facebook.com/docs/reference/dialogs/&
  picture=http://fbrell.com/f8.jpg&
  name=Facebook%20Dialogs&
  caption=Reference%20Documentation&
  description=Using%20Dialogs%20to%20interact%20with%20users.&
  redirect_uri=https://mighty-lowlands-6381.herokuapp.com/


3. Google +


   https://plus.google.com/share?url=http://jack.artoir.com


4. Pintrest


http://pinterest.com/pin/create/button/?url=http%3A%2F%2Fbrightpinkstudio.com%2Fpinkink%2Fresources%2Fsocial-bookmarking-widgets%2F&
media=http%3A%2F%2Fwww.onlywire.com%2Fimages%2FMainIllustrationz.jpg&
description=10%20Social%20bookmarking%20widgets%20for%20your%20website%20or%20blog%20-%20analyzed%20and%20compared.


5. Linkedin


http://www.linkedin.com/shareArticle?mini=true&
url=http%3A%2F%2Fbrightpinkstudio.com%2Fpinkink%2Fresources%2Fsocial-bookmarking-widgets%2F&
title=10%20Social%20Bookmarking%20Widgets%20Compared%20%7C%20Design%20by%20BrightPink%20Studio&
summary=10%20Social%20bookmarking%20widgets%20for%20your%20website%20or%20blog%20-%20analyzed%20and%20compared.
&source=

6. tumbler


http://www.tumblr.com/share/link?
url=http%3A%2F%2Fwww.tumblr.com%2Fexamples%2Fshare%2Fsharing-links-to-articles.html&
name=Sharing%20links%20to%20articles&
description=This%20example%20uses%20an%20advanced%20Tumblr%20Button%20in%20the%20article's%20footer%20to%20let%20Tumblr%20users%20easily%20share%20a%20beautifully%20formatted%20link%20to%20this%20article%20on%20their%20blogs.