javascript

Firefox DOMParser problem

For some reason DOMParser is adding some additional #text elements for each newline \n for this url http://rt.com/Root.rss ...as well as many other RSS I've tried. I checked cnn/bbc feeds, they don't have newlines and dom parser handling them nicely. So I have to add the following before parsing it var xmlText = htmlText.replace(/\n[ ...

Html 5 Time Tag not recognized by IE8 when cloning

I have been having trouble getting IE to recognize the new Time tag in this context. This all works great in FF. Here is the code: var origComment = $('.articleComment:first div'); if (origComment.length > 0) { var commentHtml = origComment.clone(true); commentHtml.find('time').text('today'); var html = '<article class="' + ((side == 'L...

How can I make Google Maps icon to always appear in the center of map - when clicked?

For simplicity sake, lets use the XML example on Econym's site. http://econym.org.uk/gmap/example_map3.htm Once clicked, I would like icon balloon to be displayed in the middle of the map. What might I need to add to Mike's code to get this to work? I apologize for asking a lot.. Thanks in advance. <script type="text/javascrip...

Parallel scroll textarea and webpage with jquery

This is both a conceptual and how-to question: In wiki formatting, or non WYSIWYG editor scenarios, you typically have a textarea for content entry and then an ancillary preview pane to show results, just like StackOverflow. This works fairly well, except with larger amounts of text, such as full page wikis, etc. I have a concept that ...

Stack overflow error in IE 7 and 8

I have a rails application in which i am using scriptaculous,prototip,controlMModal(livepipe.net). I am getting an error in IE 7 and 8 as web page error (alert box) The error is "Stack overflow at line 1715" Versions used: scriptaculous v 1.8.3 prototip 2.2.0.2 prototype 1.6.1 controlmodal 2.2.3 (livepipe.net) ...

How to get all <img> tags inside a text selection?

I've looked around for a while, but there doesn't seem to be a simple way to do this. jQuery doesn't help the in least, it seems to entirely lack any support for selection or DOM ranges. Something which I hoped would be as simple as $.selection.filter('img') seems to only be doable with dozens of lines of code dealing with manually enume...

How do I put unordered list items into an array

Hi, My code is... How do I get the text in each list item into an array using native javascript? <ul id="list"> <li>List Item 1</li> <li>List Item 2</li> <li>List Item 3</li> <li>List Item 4</li> </ul> <script type="text/javascript"> var list = document.getElementById('list').childNodes.TextNode; for(var i=0;i < list....

Chrome/IE table cell positioning help

I am making a tiny script to make a HTML element editable. When you click on an element, it gets replaced with a textarea, and you can basically enter the new text. When you press enter, the textarea is replaced with the original element with its innerHTML updated. The demo of the script is here: http://iambot.net/demo/editable/ Now th...

help for writting a regular expression in javascript

Hi guys... I want to write a javascrpit code with .Split() that split a string with structure described below: The input: W1...Wn=>S1...||...Sm||Sj...Sk|Y1...Yn=>D1...Di||Dm...Dn|... The Output: W1...Wn=>S1...||...Sm||Sj...Sk Y1...Yn=>D1...Di||Dm...Dn ... I've seen the question that split this string: a=>aa|b=>b||b|c=>cc . but my...

How can i return the value of disabled drop-down field after submit?

Hi, I have a drop down field that if any items of it selected,it would be disabled,after that i submit the form,but then (after submitting) the drop down field dosent have any value, I want to have a value after submit but my drop down field is empty. Thanks for any help, (sorry for my English) Hi again , My problem still remains but t...

sort outer array based on values in inner array, javascript

I have an array with arrays in it, where I want to sort the outer arrays based on values in a specific column in the inner. I bet that sounded more than a bit confusing, so I'll skip straight to an example. Initial data: var data = [ [ "row_1-col1", "2-row_1-col2", "c-row_1-coln" ], [ "row_2-col1", "1-row_2-c...

Delete text from copied text

Hello, I would like to use JavaScript to clean up text that’s being copied from my site. I use snippets like this: body { vertical-align: middle; ➊ } Where ➊ indicates comment later on. I want readers to copy this snippet and use it – so I need to delete that Unicode marker. How can I access text that’s being copied and make cha...

Adding view cart function

Hey guys need some help in adding a view cart button but I'm stuck not sure how to code it. any help? The way I have coded it is that when a user clicks 'add item' they will get a alert box with info about the total price but I want that to appear in the HTML file but only once I have clicked on 'view cart' and I need it to be in a tabl...

Position: absolute a div over Flash

Is it possible to position: absolute a <div /> over a Flash banner without adding wmode="transparent" to the banner? I have a lightbox that needs to appear above my ads but I can't directly modify the banners as they come from a third party. Edit: The problem mainly occurs in IE where the Flash banner is shown above the lightbox. ...

How to add on key down and on key up event in java script

Hello , I am creating an live search for my blog..i got this from w3 schools and i need to add on keyboard up,down mouse up and down event ... <html> <head> <script type="text/javascript"> function showResult(str) { if (str.length==0) { document.getElementById("livesearch").innerHTML=""; document.getElementById("livesearch").sty...

Sanitizing user input before adding it to the DOM in Javascript

I'm writing the JS for a chat application I'm working on in my free time, and I need to have HTML identifiers that change according to user submitted data. This is usually something conceptually shaky enough that I would not even attempt it, but I don't see myself having much of a choice this time. What I need to do then is to escape the...

CSS3 transition events

Are there any events fired by an element to check wether a css3 transition has started or end? ...

Is there a way to disable Tiny Scrolling for just one div?

Didn't want to create a new question so I'll just refrase this one, is there a way to disable the Tiny Scrolling plugin for just one particular div? Thanks :) ...

Calling and consuming a JBoss Web Service from JavaScript (AJAX)

I am fiddling around with JBOSS's Web Services, and I have created the following: http://127.0.0.1:8080/IM/TestService?wsdl Now I need to access Web Methods from that Web Service from JavaScript. Say I have a web method named foo in TestService, how do I make an ajax call to it? I tried accessing the method via http://127.0.0.1:8080...

toJSON "Object doesn't support this property or method"

I've a Javascript Class and its method. But when i call it toJSON is generating an error. I couldn't figure out why this error is happening. try { if (this.TabloEkId == undefined || this.TabloEkId == "") { throw errEksikVeri; } fAjaxSetup(fBefore, fSuccess, fError, fComplete); $.ajax({ type: "POST", ...