javascript

JavaScript next sibling?

Hi, Could someone show me how to loop through the anchor tags within a div and find the next sibling? I have this so far. var menu = document.getElementById('menu'); var links = menu.getElementsByTagName('a'); How do i loop through the links? Can i use .nextSibling to find if the next sibling is a div? ...

adding and removing css classes on href

Hi I have a page with 2 links on it. The page URL is example.com/all Now the 2 links on the page, one goes to example.com/all/list and the other to example.com/all/map What I want is when the user lands on example.com/all, class for the href link needs to be 'current' When I click on example/all/map the map link needs to have the clas...

Hidden JavaScript eror

When i navigate across the application, i get a javascript error in my taskbar but gets disapperard immediately before i can identify what is the error about The error appears in IE and i don't see anything in FireBug ...

why are there so many JavaScript errors on stackoverflow.com itself?

I'm using IE8. I noticed a lot of errors popping up whenever I visit stackoverflow.com. master.js line: 1 'jQuery' is underfined question.js Line: 1 Object expected ask Line: 25 '$' is undefined global-login.js Line: 154 Object expected ask Line: 141 Object expected ask Line: 149 'jQuery' is undefined tageditor.js Line: 1 Objec...

Flyout Block - jQuery

I want a container inside the page to take the whole width of the page and overlayed on everything else, when active. This is what I have currently and its not working as I want: $(function() { $('.main a').click( function() { var href = $(this).attr('href'); $(href).animate({ width: [940, 'swing'], ...

How to call WebStart-deployed applet functions from javascript?

I would like to be able to call with javascript a function of my JNLP class. Let's assume in my applet I have a function defined like this: public String returnSomething(){ return "bla"; } <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <!-- ########################## IMPORTANT NOTE ############################ --> <!...

When a span is faded out using JQuery my input box jumps left. How to get it to slide?

Hi, I have a span which contains 2 radio buttons and 2 labels. When a user selects a specific value from a drop down list it is not applicable to have the radio buttons showing so I fade them out. Again when a different value is selected I fade them back in. When I fadeOut the span which contains them the text input box on the right ...

Javascript regex replace - swap position

I need a javascript regex replace function to turn <font anything_possible><span anything_different_possible></span> into <span anything_different_possible></span><font anything_possible> I tried many combinations but failed. Any help appreciated. ...

Autocomplete list from hidden anchors on page

I need to pass 300 or less strings from anchors of tags on page to jquery's: var availableTags = [ "my tag", "my tag1" ]; Taglist Server gives me a taglist only of a certain format were the number of tags is 300 (or less). Every anchor is put in the div. That div has a static class "tagItem": <div class="tagItem"> <a href="/search/...

replacing strings which does not match the pattern in JavaScript regex

Possible Duplicate: splitting a string in js where a pattern DOES NOT match? i want to replace the lines with "!REPLACED!" from the text similar to this but those which does not match URL pattern or in simple words, which does not begin with http:// or httpS:// Some Good Tutorials http:// a.com/page1 http:// a.com/page2 Some ...

HTML5 Database API : Synchronous request

Hi, i currently use the client side database on an html5 iphone webapp. In my code i need to check if a row is present in the local DB : function isStarted(oDB) { var ret = null; oDB.query(sql,params,function(transaction,result) { if(result.rows.length > 0 ) { ret = true; } else { ret = false; } }); ret...

Easiest way to run javascript on server side

I have an application which runs on mobile devices such as android, and I have some third party traffic tracking js code to track the usage of my application. So everytime a user opens up my application the js code sends a ping to the 3rd party tracking server. However I'm not sure if there's an easy way to embed the js code directly int...

Would this be a good substiute for javascript not having a static keyword?

function get_radio_value() { for (var i=0; i < document.fm1.gp1.length; i++) { if (document.fm1.gp1[i].checked) { var rad_val = document.fm1.gp1[i].value; if(rad_val == "Last Name"){ get_radio_value.url = "rpc.php"; } } } } then outside the scope you can call alert...

Looking for A Gallery Running On Javascript and/or JQuery Like One Click To Many Showcase

To see the example please visit the web page: http://www.youpluswephotography.com/ and click one photo you will see many photos appearing. How can I make it using JS or JQuery or what else? I will use .NET for active server pages. ...

How to add contentEditabled div with prototype in IE8

Hi I have the following piece of code: <form action="/fake" > <div id="root"> </div> </form> <script type="text/javascript"> var root = Element.extend($("root")); function addTextControl() { var textCtl = new Element('div', { 'contenteditable': 'true'}).update("Next page"); root.appendChild(textCtl); ...

Use swfObject to embed flash code?

I have this embed code for a flash project: <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="333" height="380" id="RallyHorseRace"> But it is not showing up in Chrome. Any suggestions why it is not showing up in Chro...

HTML 5 canvas animation - objects blinking

I am learning ways of manipulating HTML 5 Canvas, and decided to write a simple game, scroller arcade, for better comprehension. It is still at very beginning of development, and rendering a background (a moving star field), I encountered little, yet annoying issue - some of the stars are blinking, while moving. Here's the code I used: ...

How does one insert XSLT elements with attributes inside of javascript inside of a html attribute?

Question summary: What changes do I have to make to make the following xslt document valid. The following is a simplified version of a theme document I am trying to modify for a Gizmox WebGUI DataGrid control. The issue I am having with it is the horrendous onclick event attribute on the button element. I have tried the code both this...

Cross-domain scriptable Silverlight application

I'm having problems with cross-domain application hosting with Silverlight. I have an application hosted on a different domain and included with the following HTML code to the page: <script type="text/javascript"> function succ( sender, args ) { console.log("SUCCESS"); console.log(sender); console.log(args); } function err(...

How to call a function with jquery blur UNLESS clicking on a link?

I have a small jquery script: $('.field').blur(function() { $(this).next().children().hide(); }); The children that is hidden contains some links. This makes it impossible to click the links (because they get hidden). What is an appropriate solution to this? this is as close as I have gotten: $('.field').blur(function() { ...