javascript

Add the list content at the end???

Hi Actually my code is--- function addElement(url,imagePath){ alert(url); alert(imagePath); var container = document.getElementById('sncs'); var new_element = document.createElement('li'); new_element.innerHTML ="<a href='#'><img src='"+imagePath+"' alt='' title='' width='466' height='165' onClick=\"javascript:addWidget('"+url+"')...

Filtering content (jQuery)

HTML: <div class="filter"> <a href="#category-1">category 1</a> <a href="#category-2">category 2</a> </div> <ul class="items"> <li class="category-1">item 1</li> <li class="category-1">item 2</li> <li class="category-2">item 3</li> <li class="category-2">item 4</li> </ul> What I want is for example clicking on ...

Preserving Tabs in POST Data

I need to preserve tab characters from a textarea through POST Data. It seems that there's no way to differentiate tabs from spaces in the $_POST array, and this is really frustrating me. I'm using a jQuery plugin from here to allow for tab and shift+tab usage within a textarea. http://teddevito.com/demos/textarea.html The jQuery plugi...

Managing active state (jQuery)

<ul> <li><a href="#">item 1</a></li> <li><a href="#">item 2</a></li> <li><a href="#">item 3</a></li> </ul> On click, I'd like to addclass active to the parent li element while also removing the active class from any other element which may be active already. Thanks! ...

JQuery focus an element

In javascript the following works to give focus to the edit_2 input box: document.getElementById("edit_2").focus(); However using Jquery this does not: $("#edit_2").focus; ...

convert xml.documentElement.getElementsByTagName("marker")[index].getAttribute(temp) to string in javascript

I am parsing xml file in javascript and after that want to cancatenate all the the data into string. but failing to do the same and it is returning undefined. GDownloadUrl("./include/dataemp2.xml", function(data) { var xml = GXml.parse(data); markers = xml.documentElement.getElementsByTagName("marker"); for(var ...

How to change browser focus from one tab to another

Hi Folks, I have a JavaScript chat client running in one browser tab (call it tab A). Now when a message arrives the user might be on another browser tab (call it tab B). I'm looking for ways to change the focus from tab B to my chat client (tab A) when such a message arrives. I could not find a way to do this. Any idea? Thanks, Max ...

how to apply scrollBar to the form manually in palm application

hi in my project that is developed using palm technology ie webos ,in this application form is not get scrolling option automatically,so i have to apply scrollbar manually.with this user can feel userfriendly.could some help me in this isue hoe to apply scrolling manually. thanking u ...

Call javascript function from Java (Groovy) class

Hi, I have a javascript function (very big one!) that I need its functionality in a Java (Groovy) class. It is a simple calendar converter. I can rewrite it in groovy but just want to know if it is possible to call javascript function from a java (groovy) method? I guess functional testing libraries like selenium and Canoo should have ...

Prevent flash opening new windows

Is there anyway to prevent flash files (swf) that are embeded within a webpage from opening a browser window? Eg. prevent the links within a flash file from opening new windows. Possibly with javascript/jquery? ...

translating Ecmascript (Java,javascript,Actionscript) knowledge to Objective C

Hi Newcomer to Objective C and trying to translate concepts and sytax I know from ecmascript based languages to Objective C. Is it proper to think of the .h header file in ObjectiveC as an Interface in Actionscript? Lets take the following code example in Objective C which calls a method containing 2 arguments [myTextObject setString:...

Why this code works with jquery 1.3.2 but not with 1.4.2?

this code var tip = "<p class='adobe-reader-download'>Most computers will open PDF documents automatically, but you may need to download <a title='Link to Adobe website-opens in a new window'"; tip +=" href='http://www.adobe.com/products/acrobat/readstep2.html' target='_blank'>Adobe Reader</a>.</p>"; if($("div#maincontent a[href*='.p...

how to display a SWF over a span or div?

Hi, I have a swf file with a semi-transparent + tint effect and a HTMl element <span id='mybutton'>My Button</span> I want to place the swf over the span, so that i can see div/span/a the content through swf. Edit 1 How can i write a JavaScript code to place this swf over the element have id='mybutton'. If any JQuery code available ...

Help making userscript work in chrome

I've written a userscript for Gmail : Pimp.my.Gmail & i'd like it to be compatible with Google Chrome too. Now i have tried a couple of things, to the best of my Javascript knowledge (which is very weak) & have been successful up-to a certain extent, though im not sure if it's the right way. Here's what i tried, to make it work in Chro...

Accessing datagrid cell in a javascript

Datagrid is in content,When trying to access client side function for the cells in the datagrid,its always showing at 0 position suppose i have 10 rows,for each row "Test button" i should invoke the client side java script. For each row "Test button" client side script is displaying message at first row only. in datagrid i am binding t...

Trigger Show event of file upload dialog

i want to show file upload dialog on click of a button thats not the part of input[type="file"] how can i do this? Basically i want to stylize the file upload control of html. ...

Uncaught Error: SECURITY_ERR: DOM Exception 18

I get the following error in Chrome's developer tools window when I try to set a cookie using this jQuery plugin: Uncaught Error: SECURITY_ERR: DOM Exception 18 What does this error mean and how can I fix it? I get the same error when I use this jQuery plugin. ...

What is the rule behind to divide this html in var tip?

What is the rule behind to divide this html in var tip? var tip = "<p class='adobe-reader-download'>Most computers will open PDF documents automatically, but you may need to download <a title='Link to Adobe website-opens in a new window'"; tip += " href='http://www.adobe.com/products/acrobat/readstep2.html' target='_b...

Javascript Closure question.

Why the following code prints "0 5 10 15 20 ... 100"? (function () { for ( var i = 100; i >= 0; i -= 5) { (function() { var pos = i; setTimeout(function() { console.log(" pos = " + pos); }, (pos + 1)*10); })(); } })(); I declare pos = i , which should be in a descending order. This code ori...

Using code in both Actionscript3 and Javascript

Here's an interesting architectural query. I have a piece of code that needs to run on the server (under Node.js) and on the client (in a Flash 10 app written with Actionscript 3). The code is mostly fairly intricate object manipulation, it doesn't make any API calls, and works fine in both contexts. So far the project is just a demo, ...