javascript

how is the DOM constructed in the browser (IE or FF) or how javascript traps object hierarchy

Would some please send me the link for any articles , which explains , how DOM is constructed in the browser after the response is received from server ...

change field value when select radio buttons

I want to change the value of hidden input field when radio buttons selected : <input type="radio" name="r1" value="10" />10 <br/> <input type="radio" name="r1" value="45" />45 <br/> <input type="hidden" name="sum" value="" /> for example when user click on one the buttons the value of hidden field change to that v...

How can i unserialize a string?

I have a menu system that uses a drag and drop tree structure to make it easy for a user to modify. When the javascript serializes the string, it does it in the following way: // Assume each of these items has an ID on with the respective numbers attached Menu Item 1 + Menu Item 2 + Menu Item 3 + Menu Item 4 Menu Item 5 Menu It...

What JavaScript cache can you recommend

i'm searching for a good java script in-memory cache lib to cache client side calculation results. My requirements: works in Internet Explorer, FireFox, Safari, Opera, Chrome, others a plus stable mature small fast cache strategies should be configurable several caches in one page, each with different eviciton strategy LFU, LRU a plus...

convert seconds to HH-MM-SS with javascript ?

how can i convert seconds to HH-MM-SS with javascript ? ...

Creating links for elements with a particular class with jQuery

How can I wrap every element belonging to a particular class with a link that is built from the text inside the div? What I mean is that I would like to turn: <foo class="my-class>sometext</foo> into <a href="path/sometext" ><foo class="my-class>sometext</foo></a> Url encoding characters would also be nice, but can be ignored for n...

how can i create a form like this ?

in this page : https://www.psd2html.com/order-now.html you can choose the items you want and the price will change with your selection. how can it be built ? ...

JS problem with getElementById in Explorer

Hello, The html code (with javascript) shown below works in all browsers except IE. I recently learned that IE don't want to handle the getElementById and id codes. Is somebody so kind to advise me, is there another way to get it work or is there a workaround code? Thanks in advance, Erik <html> <head> <meta http-equiv="content-type...

How can I make images fit into a 200 pixel square box using CSS?

I have a bunch of images which all fit into a 400px × 400px box (that is, one of their dimensions is 400px and the other is smaller). I would like to be able to, using CSS, but jquery/javascript if necessary, fit that image to a 200px by 200px box, so that two edges of the image touch the box, and there is a gap between the other two edg...

JQuery DOM manipulation and window.onbeforeunload in Internet Explorer

Hi, I have this code block: window.onbeforeunload = function(){ <% if (Session["DisableExitConfirmation"] == null || !(bool)Session["DisableExitConfirmation"]) { %> if (isDirty) return '<%= Html.EncodeJsString(Html.Resource("profile_unsavedchanges")) %>'; <% } else { %> if (isDirt...

Object Oriented Javascript - How To Define A Class Within A Class? from a C# example

Hi there, I know there are a lot of OO javascript questions on SO and I a have been reading a lot of resources.... BUT it is still far my most long winded learning curve so far! I am not classically trained sorry, hence I will have to just show you guys in c# an example of what I want to acheive. I hope you can help! public class Eng...

Does the order of javascript matter in a page?

Hi, As long as I am calling my javascript code from within the jquery $().ready(); function shouldn't I have access to all variables declared in my javascript code? I have code coming from .js files and inline. I tried to access a variable and it says it is not defined, but when I do a viewsource I can see that variable. ...

Creating my own callbacks

I have a page with some jQuery, and a separate non-jQuery function. Currently my function runs on $(document).ready, but I want to call a jQuery function as soon as my function is finished. I can pass my function as a callback to any jQuery function, but how can I set things up the other way round? So I would ideally like to know how t...

Detecting if a given number is an integer

Hello, what seems to be a simple question turns out as a difficult task to me. I need this: if (number == integer) if (1.589 == integer) // false if (2 == integer) // true Any clues? ...

How to measure visiting time of a user

I like to measure the time a user spent on a particualr page of my webapp. First i thought about catching the onunload/onbeforeunload event in the browser and notify the server via a XMLHttpRequest that the user is leaving now like: <body onunload="userLeaves('/url/to/current/page',xxx);" ...> ... </body> where xxx is the inital tiems...

Change CSS class based on existance

Firstly I must emphasis that the HTML is pre-generated and cannot be altered - Otherwise I would not be doing it in this way : ) So.... The script and HTML below creates a nice hide/show menu, when you click the navheader the navitem becomes visible. However I want the css class of the navheader to change based on if navitem is direct...

Loaded AJAX content breaking out of DIV tag

Hi. I'm new to Java/AJAX etc. I have a page with links down the left and a DIV on the right. I want content (other pages) to load in the DIV when users click on the links on the left... beginner AJAX stuff I guess. I played around with a few JQery plugins and found one that allows pages to load with a fade effect, which is perfect. I h...

How can you render html as it is typed into a textarea?

I am trying to render HTML as it is typed. That is, a user types HTML into a textarea and it is rendered (using javascript, I think) in a Literal or another textarea or perhaps a window within the window. Otherwise, I have to make them type it all in and then click a preview button. ...

jQuery - Multiple Field Blur

I'm working on some form validation using jQuery, validating each field onblur. Everything is working great, except when I have grouped (dependent) fields. What I'm looking for is a way to validate these fields only once all of them have been blurred. They can either be grouped as a collection of jQuery objects, or as children of a conta...

onchange insert value into hidden input jquery

Hey.. When i select some data from my option i need the value to be showed when "onchange" the select... can someone help me ? <select name="search_school" id="search_school" onchange="$('#search_school').val() = $('#school_name').val()"> I want the selected option value to be showed in the hidden input <input type="hidden" name="...