javascript

how to add a sound to link

HI all, I want to add a sound to my link please tell me is there any jquery or javascript to add sound i have used following but its not working.. <div align="center"><a href="our_product.html" class="footermenu" onmouseover="MM_controlSound('play','document.CS1276334226609','drop/downloadb12bb644.mp3')">Our Product I</a></div> Thank...

How to insert additional text using jquery or javascript

I want to know is it possible to insert additional text in HTML elements using jquery or javascript? If there is already a text "Down" in paragraph elements, then I just want to append text "full", so that it would be "Down full". Is this possible? Which method should I use? ...

How to create a stackoverflow like Q&A board ?

Hello, After using stackoverflow for weeks i am just addicted by its system and the "badges" system. Is it possible to create a simple Q&A board with this concept or is there any tutorials ? ...

Javascript and rendering pauses and stays paused on scroll in the android browser

Hi. I've found some wierd behaviour related to scrolling and rendering and javascript. How to make it happen: On any webpage that is long enough to scroll on. Start to scroll pretty fast (fling the page). then release the touch. Now while the page is still scrolling because of the momentum. Tap the screen to stop the scroll. This ma...

How to disable back button of a browser

Possible Duplicate: Disabling Back button on the browser How do I disable the back button of a browser using JavaScript? ...

calling a java servlet from javascript

I am trying to create a web application using the MVC design pattern. For the GUI part I would like to use JavaScript. And for the controller Java Servlets. Now I have never really worked with JavaScript, so I'm having a hard time figuring out how to call a Java Servlet from JavaScript and how to get the response from the Servlet. Can...

Javascript replace

Hello struggling here guys.. Is it possible to string replace anything between the the first forward slashes with "" but keep the rest? e.g. var would be string "/anything-here-this-needs-to-be-replaced123/but-keep-this"; would end up like this string "/but-keep-this"; Hope that made sence ...

Stack Overflow works best with JavaScript enabled banner

I am trying to mimic this site's Javascipt required banner, and have the below divs which are being hidden if javascript is allowed/enabled, but I am getting a flash/glimps of it on page load. <div id="Main_noJS">Craftystuff.com works best with JavaScript enabled</div> <div id="PartOfMain_noJS"><br /></div> CSS: #Main_noJS { widt...

javascript splice() indexing problem

I have to add some value to an array. Code for example : temp[0]=new Array("0","0"); temp[1]=new Array("0","0"); temp[2]=new Array("0","0"); temp[3]=new Array("0","0"); temp[4]=new Array("0","0"); vt=new Array("1","0"); temp.splice(3, 0, vt); temp.splice(4, 0, vt); temp[3][1]="R"; I expect this output : 1 - 0,0 2 - 0,0 3 - 0,...

Javascript looping only through defined properties of array. How?

For example if i'm keeping array of references via id like that: if(typeof channel_boards[misc.channel_id] == 'undefined') { channel_boards[misc.channel_id] = $('<div class="channel" channel_id="'+misc.channel_id+'"></div>').appendTo('#board'); } And then i'm looping through array to find required reference. I'm looping through u...

Jquery add drop shadow to layover

I am using this layover plugin to display content: http://jquery.com/demo/grey/ I know there must be a simple way to add a drop shadow border to the layover, similar to: http://fancybox.net/ but I can't figure out what the best method would be. Any suggestions? ...

Prototype or jQuery for DOM manipulation (client-side dynamic content)

I need to know which of these two JavaScript frameworks is better for client-side dynamic content modification for known DOM elements (by id), in terms of performance, memory usage, etc.: Prototype's $('id').update(content) jQuery's jQuery('#id').html(content) EDIT: My real concerns are clarified at the end of the question. BTW, bot...

Javascript, html: How to tell if option box is has been set?

Hi There, I am having trouble finding out how to figure out if a a html dropdown box has been set? Ok, I understand how I acn check the index once it has been activate and an item chosen. But, how do I determine that the box ahsn't been touched and no item selected? Thanks. ...

jQuery and margin: 0 auto

So, this is a problem that's been asked before, but I'm hoping we can lay it to rest: I'm using jQuery 1.4. If I define the style #obj { margin: 0 auto; } and then do $('#obj').css('marginLeft'); the result is the computed value in pixels. Is there any way to tell whether those pixels come from the auto calculation or not, without ...

disabling "block selection" on an iPhone

I am building an app for iPhone that has javascript running in a webview. When the new auto-select block selection tool is used to select text, and the block is resized from the side, it makes my javascript freak out. Does anyone know a way to disable the copy/paste for block selection? I still need to be able to select text, just not...

Can I interrupt javascript code and then continue on a keystroke?

I am porting an old game from C to Javascript. I have run into an issue with display code where I would like to have the main game code call display methods without having to worry about how those status messages are displayed. In the original code, if the message is too long, the program just waits for the player to toggle through the...

Setting asp:Image URL using Javascript function

Hi all I have a series of asp:ImageButtons and one asp:Image(Big). Clicking on each ImageButton should change the ImageUrl of asp:Image to a new ImageUrl. How can we handle this using one Javascript function. Because I dont wanna code ImageButton_Click for each and every asp:ImageButton. This makes my application run very slow and also p...

Take <span> class and put in <a> attribute jquery

Hello, I have html like this. <span class="gallery-open-item year-icon-Yes 2010"> <a href="/year/none"> </a> </span> I need to check using jQuery if span.gallery-open-item has year-icon-Yes class, and if so take the next (for this example is 2010) class and place it in the href attribute like this: <a href="/year/2010"/> All this ...

How to preserve the state of JavaScript closure?

I am working on a migration platform to migrate web applications from a device to another. I am extending it to add the support for preserving JavaScript state. My main task is to create a file representing the current state of the executing application, to transmit it to another device and to reload the state in the destination device....

How do I make the "back button" work with jQuery hide/show functions?

I'm looking for a way to append text to the url with jQuery so that the back button is not broken when a user loads new content with jQuery. For example, I have a three step form - the first step is (www.xyz.com/form-1). When the user clicks next step, jQuery slides in the next page. I would like that page to be (www.xyz.com/form-2)...