javascript

Differences between SWFAddress and JSInterface... which to choose?

What are the differences between SWFObject/SWFAddress and JSInterface? JSInterface has a lot more functionality but SWFAddress seems to be the standard, so I'm wondering what you choose to use and why, and if you could use both of them. Can you even do SWFAddress-like things with JSInterface? I can't seem to find out how to do "back",...

To find out if a div has a scrollbar

If a div is set as overflow:auto, how can I find out (using plain JS) if a scrollbar (Vertical / Horizontal) has been rendered? ...

Is it possible to make one site for all type of screen resolutions mobile to PC?

Can we make website scalable , stretchable like elastic rubber including text ,images, video, JavaScript and that site should be accessible from all devices which access to web? I want to set max-width 980 px for site but minimum width can be everything and height should depend on content. ...

Non-browser emulation of JavaScript - is it possible?

I have a new project I am working on that involves fetching a webpage, (using PHP and cURL) parsing the HTML and javascript out of it and then handling the data in the results. Basically I hit a brick wall when the site uses javascript to fetch its data by AJAX. In this case, the initial data will not appear in the fetched page unless ...

Positioning JQuery UI Dialog near clicked link

Hi all, I have the following jquery function for some links $(".clickable").click(function(event){ // load dialog content... $("#dialog").dialog(); return false; }); What i'd like to do is have JQuery's UI dialog display near the clicked link. Is there any way to do this using just JQuery. Thanks! ...

Stack Overflow in IE with JQuery (at line 12/1076)

I'm using JQuery from Google CDN and I've been getting stack overflow error (using IE8) at lines 12 (for the min file) and 1076 (for the uncompressed one). The JQuery code at the line where stack overflow error takes me to is: JQuery.js ... makeArray: function( array ) { var ret = []; if( array != null ){ var i = array.length; /...

(rails) how does one correctly link to a javascript file in a rails view?

Is there a helper of some sort? I want to make a javascript file, put it in the rails directories somewhere, and have the file be included in a view so I can use the methods and functions I declare in the file. ...

Google AJAX search api

Using the Google AJAX search api How can I call a search from my own text box? And parse the results in javascript? ...

How to replace content of a popup window with an AJAX request?

I am at loss to understand how popup windows´ DOM-trees and their manipulation from opener window work. What is the proper way to implement what I am trying to do (described below)? I have one normal browser window where JavaScript function gathers selected elements and creates POST data string from them. I then open a popup window with...

Weird outline when clicking contentEditable div

I'm trying to create a textarea that can contain multiple colors. I created a div and in JS did the following: element.unselectable = 'off'; element.contentEditable = true; The div is now editable, but when I click in it, it gets a weird outline. How do I turn this off? ...

How to create the effect like this page?

Click "Reply by Email" of that page, http://losangeles.kijiji.com/rooms-roommates/el-monte/room-for-rent-el-monte-california-91732/?ad=785656 ...

3-way merge in JavaScript or PHP

Does anyone know of an Open Source three-way merge implementation in JavaScript or PHP? I want to merge plain text files without the need to rely on any server side binaries. I found a few solutions for creating diffs, but no merge implementations. ...

javascript ONLY loader before aspx...like gmail.com login loader

Hi. I have a Home.html that has a login form that POSTS to login.aspx the login.aspx takes a hell lot of time to load... so i want to have a javascript based function where the instant i click Login Button, a loader must be shown ...while in the background the POST happens and then aspx page must get loaded and then the modal must redir...

How to override inline css through javascript ?

can we override inline css through javascript? with IE6 compatibility. I found this pure css solution but not works in IE. http://nataliejost.com/override-inline-styles-from-the-stylesheet/ http://www.sitepoint.com/blogs/2009/05/27/override-inline-css/ <div class="block"> <span style="font-weight: bold; color: red;">Hello World</...

javascript object arrays

I need to migrate a code in java to javascript. In java, I am maintaining a hashmap with key = string and value = arraylist of objects I need to implement the same in javascript: this.hashMap = new Hash(); this.hashMapArrayList =[]; ... var hashMapDataSet = new HashMapDataSet(id1,name1,type1); this.hashMapArrayList[0] = hashMapDataSet;...

Can we add any attributes to any XHTML Tag through Javascript ? for example title in <a title="text>

For some reason I can't edit XHTML source. Can we add any attributes to any XHTML Tag through Javascript, for example title in <a title="text">? ...

Javascript HTTP Request Queue within object variable - initialization doesn't work

Hi folks, I got the following Request Queue implementation from this blog: http://dsgdev.wordpress.com/2006/10/28/building-a-javascript-http-request-queue/ and want to wrap it with a object variable. Unfortunately the variable initialization inside doesn't work. Hope someone can help me with this stuff. Thanks in advance var reque...

Get position of element by javascript

I've seen a dozen of script that can catch the x and y position of an element/object within the page. But i am always having trouble with catching the x and y when the webpage is using margins at the body, or other elements, absolute/relative elements, such like that. Is there a solution wich provides the exact position, no matter what ...

Parsing every element of an array as an integer

I have a string which I need to split into an array and then perform mathematical functions on each element of the array. Currently I am doing something like this. (Actually, I am doing nothing like this, but this is a very simple example to explain my question! var stringBits = theString.split('/'); var result = parseInt(stringBits[0...

Can i call web service from java script?

Hi Friends Can i Call web service from java script? Thanks ...