javascript

Invalid procedure call or argument IE issue when iterating through document.styleSheets using $.each()

I've written this code that iterates over all global style sheet rules and stores them in an array/object. I use this dictionary-like object later to change global rules rather than setting styles on individual elements. Following code breaks in IE8 but works fine in Firefox3.7 and Chrome4. var allRules; $(function() { var fileRul...

Parent category as a mainmenu and sub category as a submenu in wordpress

Hai, I would like to have a parent category as a mainmenu in horizontal view and child categories as a submenu that corresponds to the mainmenu. For example, Parent categories as Apple, Orange and Mango Sub Category for Apple is apple1, apple2, apple3 Sub Category for Orange is orange1, orange2, orange3 Sub Category for mango is...

JavaScript how to pass arguments

function f1(i1, i2) { log(i1); log(i2); } function f2(i1,i2){ f1(arguments); } f2(100,200); In the above case in function f1 i1 gets [100, 200] while i2 is undefined. What is the correct way to pass arguments to f1 from f2. ...

Silveright calling javascript issue?

I'm calling out to javascript from a SL component using the HtmlPage.Window.Invoke api, when I call a javascript function defined in the page (html) it executes as expected, e.g. HtmlPage.Window.Invoke("publishValue", topic, jsonObject); But when I place the javascript function in a *.js file it is failing to execute the method even t...

What is the easiest way to call a C# method from Javascript

I have an LinkButton control which I need to add a c# method to. Currently when I use parse control and add the control to the page it changes the call to javascript and I get undefined. I figure a way around this would be to define a javascript function that would call the c# method from the code behind, but I cannot figure out how to d...

Not able to access value from Model Map in jsp

Hi I have a Spring sample application. In the controller,I'm having a ModelMap map = new ModelMap(); map.put("samplebean", sampleBean); Where samplebean is a bean . I have a tag which has an attribute name. and the name is actually the bean name. In jsp if I access alert('${samplebean.value}'), then it alerts the correct value. But th...

Can I pass a JSON object from Silverlight to javascript

I know I can call javascript and pass string values from Silverlight, but can I pass a JSON object or does it have to be serialized? ...

problem with prototypejs event listeners and firing events

I am learning the prototype framework and javascript in general and am tring to refactor a bit of existing code to create some html from data inside of a class using an event listener. I am having problems getting the events to fire and getting the corresponding listener code working. Here is a small example, that I can't get working: <...

How to limit checkbox selections to one in a html document when the list containing the checkboxes is being gennerated by .js

The intent is to use an html dialog box as a settings page for a program. In this settings page, the user can create a list of salespeople that can be selected later on from a drop-down box. My goal now, is to add a checkbox that indicates witch salesperson is the default selection in that drop-down list. Here's what i have so far: Thi...

modify a mapfile Online

hello, how can I rename files and strings in a mapfile in real time on a web application. thanks for answers ...

value set by javascript is not saved in asp.net

hi, i am having two textboxes and a label in a gridview control, i am adding a javascript function to the second textbox onblur event attribute and display the result in the label, the function works fine and result is displayed in the label, but when i am saving the grid data into the database, the label is returned 0 or empty, but i am...

Javascript flip animation without jQuery

Does anyone know if there is a Javascript flip animation around, similar to this one: http://lab.smashup.it/flip/, but that does not use jQuery. I Googled before posting this question, but they seem all to use jQuery. Thanks! ...

temporary tables or attributes

hello, how do I create and manipulate information temporarily spacial? and codify so as not to overwrite and to be used in a web application. thanks for answers ...

Get all form tags with javascript/jQuery?

Is there any such function to get all form tags? by form tags I mean all <input>, <select> etc? Thanks ...

Mobile Safari scrollTo w/ textarea bug

Hi all, Have stumbled upon what seems to be a bug with how mobile safari renders the cursor when a window.scrollTo() is executed while a user is entering text into a textarea. Have attached source code which illustrates the issue. I'm wondering if anyone has any advice on how I might work around this. The issue: If a user is enterin...

Redirecting someone

Hello. I want to redirect someone to index.php, how do i do this? But not the "meta" method, because it needs to be in header, and i can not have it there. ...

Get all visible DIVs on a page with javascript?

Another short Q, is there any short piece of code to get all DIVs on a page which have the visibility set to 'block' or 'inline'? Thanks ...

Submit text and Wysiwyg form to both Database and flat file.

I've created a form that is made up of 2 input fields and a wysiwyg text area (ckeditor). I have a function using ajax to gather the ckeditor data to be submitted. I have the form properly submitting to the database, but I also need it to write to a text file. How would I go about doing this? Edit to include code: using onclick to subm...

Inserting many DOM elements chokes

I've got a loop where I insert about 500 <div>s into the DOM via document.getElementById(target).appendChild(docFragmentDiv), and each <div> has probably 20 or 30 descendants. I can insert up to about 100 just fine, but the page temporarily freezes while the DOM is updated if there's something like 200+ inserts. How can I avoid this cho...

JavaScript: Global variables?

When I use code like this, it works fine: function removeWarning() { var systemStatus = document.getElementById("system-status"); systemStatus.innerHTML = ""; } function indicateInvalidUsername() { var systemStatus = document.getElementById("system-status"); systemStatus.innerHTML = "Invalid username"; } However, when...