Saran Chamling loves the web technology, and enjoys designing, exploring and writing about it @sanwebe.com. You can find him at Twitter, Google or Facebook.
If you want to restrict users from entering more than one or two URL, just use the following jQuery snippet. All we need to do is use RegEx expression and using JavaScript match(), we can search for URL or some other words in textarea.
I assume you are using Facebook PHP SDK in your project, if you need to check multiple permissions granted by the user using PHP, try following method. We will break string into an array, and then check for the permissions already granted by the user.
If you want to show confirmation dialog before user leaves or reloads the page, you can use Javascript onbeforeunload() event attribute. When unload event fires, it shows a prompt asking whether user wants to leave or reload the page. Most browsers will return the event string, but in some browsers such as Firefox it may not be displayed.
If you have very long pages like Wikipedia, you might want to organize your paragraphs with some sort of stylish scrolling Table of Contents (TOC). In this article we will create a nice little Table of Contents with bit of jQuery and CSS3. Div element stays fixed on the left or right side of the page for easy navigation of the page, it can be expended and collapsed easily by a reader.