javascript

jquery heirarchical menu design

edit: ok, the line: $( <?php echo("'#".$_GET['item']."'") ?> ).parent().show(); Is obviously and attempt to keep the menu open at the right place. I don't think this ever worked (got I hate working on other ppls code). Then my current problem is how to access the <ul class="myul"> directly above the <li id="001" > using that item ...

Password fields not clearing on submit in asp.net mvc

I have a user preference page in which the user can type in their current password, new password and confirm new password. When the user submits the form it sends them to an action. The problem is that when the form submits, the password fields stay filled. I want them to clear. I attempted javascript but when I use document.preferen...

WYMeditor won't reflect contents into textarea value

I started deploying WYMeditor across all the content types on a site, and its looking good. Now I got to see how it works saving and viewing, but its not submitting anything and I have no idea why. I've looked at this from several angles. I would even take a monkeypatch at this point, if I can learn how to grab the data myself I can sti...

POST BACK in PHP or JAVASCRIPT?

how can I post back the data that are already in the text field? example: if I miss one of the required field an error will prompt when i click the submit button. How can I make an post back data in that form using php or javascript and make the cursor of the mouse directly located to the field that caused an error? ...

jQuery - Find the next element which has a specific child

Lets say I have something like this: <tr> <td><input type="text" /></td> <td>Somevalue</td> <td><intput type="text /></td> </tr> I am in the event handler for a keypress in the first text box. I want to find the next td which has a text box in it if it exists using jQuery. ...

IE hang for 5 minutes when calling synchronous xmlhttprequest

I have a web application and use ajax to call back to my webserver to fetch data. Sometimes(at rather unpredictable moments, but it can be reproduced) IE hangs completely for 5 minutes(the window says Not Responding) and then comes back and the xmlhttprequest object responds with error 12002. The way I can reproduce it is as follows. ...

Does this fit your definition of a Callback?

Definition of Callback: A Function that is set as a property within a Component. And is usually called when some event occurs on the Component. For Example: If you wish to display a dialog which reads "I was clicked" when the user clicks on the Component componentB, you would write a method stored as a variable which does this: var ...

Does this match your definition of a Listener Object?

Overview: In my project, all of the UI Components that are rendered in DOM/HTML, are stored/managed as Javascript objects of type Component. Each Component Object contains a ComponentListener class which listens for events coming from the DOM/HTML rendering, and also listens for events fired to the Component that it might receive fro...

margin and padding are causing issues calculating layout

I am having this issue where I am not getting the true offset in IE6. I am using the offset to position a pop-in. The CSS is something like this: .container50-50-right-border { } .container50-50-right-border .title {padding: 0px; margin: 0px; clear: both;} .container50-50-ri...

How is a closure different from a callback?

I asked a question about callbacks and arrived at another question (see comment). How is a closure different from a callback? ...

jQuery width() returns 0

I'm writing a jQuery plugin that handles a bunch of image animations with a simple call to the plugin function (something like $("#image1").anims() where #image1 is an image), however as part of the plugin's functionality I use $(this).width() to get the width of the image right at the start of the function call. But, since the plugin ...

How do I reference a div from javacript in pocket ie ?

Hello i'm developing a pocket ie site. Im runnning pocket PC 2003 SE emulator with pocket ie. i have a and want to reference it from javascript. getElementById and document.getElementsByTagName don't work. In an example I saw document.all[] and even xx.id but all don't work. Can anyone enlighten me ? ...

javascript hangs browser

xmlDoc.load("cd_catalog.xml") var cd=xmlDoc.getElementsByTagName("CD"); var id_set=1; var id=xmlDoc.getElementsByTagName("ID"+id_set); i=0; function next() { if (i<id.length-1) { i++; display(); } } function display() { document.write('<div class="dd">') document.write('<div class="blue" style="WIDTH:') document.w...

VS2008 is autoformatting my javascript in a .js file and I want it to stop

Duplicate: http://stackoverflow.com/questions/605461/vs2008-removes-my-indentation-in-js-file (Turn off auto formatting in the formatting tab) Hi I have VS2008 and ReSharper 4.0 and I'm having a problem. When I enter a new line of code in any .js file, it goes thru and reformats all of the JavaScript braces. I've found where in ReSha...

Append to json

Hey everyone, I have a json object that hold alerts and information about them: var alerts = { 1:{app:'helloworld','message'},2:{app:'helloagain',message:'another message'} } along with a variable that says how many alerts there are, alertNo. My question is, when I go to add a new alert, is there a way to append the alert onto the al...

JS/jQuery: How can I select the first LI item of an UL navigation when hovering over another (lower) LI element?

Hello again. I am trying to make a navigation that uses simple unordered lists to list all the links. Basic stuff. However the first LI element has a class name of "section-title". following this 'section-title' are the links to the other pages. Now i would like to change the background color of the li.section-title to black while hove...

JavaScript augmented prototype lifecycle

Hi, If I want to add an isEmpty method to all JavaScript arrays, I would use the following code Array.prototype.isEmpty = function() { return this.length == 0; } Assume this code is in a file foo.js. If I want isEmpty to be available on all pages of a web site, would I need to include foo.js in all the HTML files? In other words, d...

Referring to a div inside a div with the same ID as another inside another

How can I refer to a nested div by id when it has the same id as a div nested in a similarly named div eg <div id="obj1"> <div id="Meta"> <meta></meta> </div> </div> <div id="obj2"> <div id="Meta"> <meta></meta> </div> </div> I want to get the innerHTML of meta document.getElementById('obj1').getElem...

Where is my one-line implementation of rot13 in JavaScript going wrong?

Code in question with syntax highlighting here: via Friendpaste rot13.js: <script> String.prototype.rot13 = rot13 = function(s) { return (s = (s) ? s : this).split('').map(function(_) { if (!_.match(/[A-Za-z]/)) return _; c = Math.floor(_.charCodeAt(0) / 97); k = (_.toLowerCase().charCodeAt(0) - 96) % 26 + 13; ...

How do you create a frozen/non scrolling window region using javascript?

Am curious to know how you create a frozen/non-scrolling regions on a webpage using javascript! like the one used by Stackoverflow when they alert you of the badge you have earned with a "X" close button! Gath ...