javascript

How to access parent iframe elements from a child javascript page?

I have 2 pages-- Parent n child. In the parent page i have an iframe whose value i want to ftech in the javascript of child page. Is there any way?....Please suggest. ...

Arbitrary-arguments JavaScript function from <head> not accessible in onclick event

Ok so this may be a dumb question (probably some syntax) but Google didn't tell me much about why this isn't working, so here goes. I have a function append_..._fields that takes an arbitrary amount of arguments, first one being the id of what to add fields onto, and all following are just names for the fields. It's hacked together so t...

gridview.getElementsByTagName("input") is giving Inputs Zero Why?

Hi All, <script language="javascript" type="text/javascript"> function ValidateNew() { var gridview = document.getElementById('ctl00_cp_GridViewKRIlib'); if (gridview != null) { var Inputs = gridview.getElementsByTagName("input"); for (i = 0; i < Inputs.length; i++) { if (...

Classical Vs prototypal inheritance

After reading about both, I just have curiosity, how programming community uses this? In what situation which? ...

Fastest modular exponentiation in JavaScript

My problem is to compute (g^x) mod p quickly in JavaScript, where ^ is exponentiation, mod is the modulo operation. All inputs are nonnegative integers, x has about 256 bits, and p is a prime number of 2048 bits, and g may have up to 2048 bits. Most of the software I've found that can do this in JavaScript seems to use the JavaScript Bi...

JS file not being updated when testing ASP.NET MVC app with VS2008

Hi, I have a MVC app developed in VS2008. When I run the app the changes I made to a JS file are not being updated. Is this the browser problem (IE7) or VS2008 dev server problem?? If I use Firefox it is updated? Malcolm ...

solution for jslint errors

Hey, I have started using JSLint,And I checked my code and I am getting this errors: Problem at line 92 character 7: Move the invocation into the parens that contain the function. })(); Problem at line 92 character 7: Wrap the entire immediate function invocation in parens. })(); How To Fix this errors? ...

Editable Text Highlighting

I would like to create an editable "textarea" with text highlighting (e.g. different colours, bold) and I am not interested in backward compatibility with old (and meybe current) browsers. It isn't a code editor, but something similar. So it is really different from CkEditor, because the content should appear formatted to the user, but ...

Scroll with no backward with IE

Hi, I am using the Mootools Fx.Scroll effect to navigate horizontally through my website sections. Everything is working properly with Firefox, but Internet Explorer gives me some trouble. First the section were a big mess, but after adding one line in the Mootools core file thanks to a lighthouseapp.com patch, the sections are now well...

Javascript infamous Loop problem?

Hi All: I've got the following code snippet. function addLinks () { for (var i=0, link; i<5; i++) { link = document.createElement("a"); link.innerHTML = "Link " + i; link.onclick = function () { alert(i); }; document.body.appendChild(link); } } The above code is for generating 5 links and bind each link with an alert event to...

jquery.parents() is selecting the grandparent and siblings of the grandparent.

What I'm trying to accomplish is when a user has focus on a text box, the field set that's in will add a class "active_fieldset" so it gives a nice visual cue of where the user is in the form. Using the following javascript, it does affect the parent fieldset but it also affects all sibling fieldsets as well. Am I doing something wrong? ...

fire a function whose name is in a string

Hi everyone, I'd like to fire a function. Unfortunately I can't call it directly as the functions' name is provided as a string. Example: function myFunction() { alert('I am myFunction'); } function anotherFunction() { alert('I am anotherFunction'); } var func_name = 'myFunction'; $obj = jQuery('a'); $obj.each(function(){ ...

automated scrolling video playback

I would like to add an automatically scrolling sidebar to go through my videos and play them back (like this: http://video.on.nytimes.com/). I'm guessing I will need to create some highly customized javascript. Do you guys have any suggestions on how to accomplish this. I'm using drupal 6 and building a custom block module to do this. Th...

php syntax for echo javascript function

Hello, I hope somebody can help me with this little problem. The problem is that I still get confused with the syntax The php line echo's a javascript function that takes one parameter, the database value. It needs to be corrected, to get it to work. extra comma's??escaping?? I never know where exactly. while($row=mysql_fetch_array($...

Access iframe elements in javascript

I have a webpage where there is a texarea within a iframe. I need to read the value of this textarea from its child page javascript. Presently by using window.parent.getelementbyID().value in the javascript, I am able to fetch values of all controls in the parent page except the textarea within the iframe. Can anyone please give me any p...

Convert Curl retrieved HTML string to JSON with PHP, serve with AJAX

Hi, I am building a scraper with Javascript (AJAX; Prototype) and PHP (Curl). The url is served trough AJAX to the PHP/Curl. The response is a huge HTML string. I would like to send the string in JSON to Javascript so I can process it. If I send the raw responseText it works just fine, the html (string) get's rendered on my screen. Ho...

I need ideas on displaying categories for a listing

I need ideas on assigning categories to a listing. The categories will be something similar to what Ebay does. Amazon and the other sites have similar categories for listings. I have a lot of categories and Sub-Categories upto 4 levels deep, like Home & Garden > Kitchen > Small Appliances > Coffee Machines Computing > Networking > Ser...

Resizing Selection Box to Hug Chosen Text

I am using Javascript to dynamically add new options to a drop down list and when the list reverts to the selected item with the arrow to the right of it to expand the list, the box containing the selected text is as wide as the widest text in the options list. So what I would like to do is have the width of the box hug the text if you ...

Pre-loading image(s) with JavaScript & jQuery

I'm using the following code to insert some HTML into a div, and to preload any images that might be contained in that HTML (the html var's data is actually fetched from an AJAX request in the real code). This is to prevent the browser from loading the fetched HTML's images upon showing the div (using the slideDown event) - because this ...

Datepicker of Jquery UI need help

Hi, I need help in attaching a date picker in my existing HTML markup. The booking form was provided by my Affiliate, Now I need their forms to be customize a little bit. I need to change their the current date picker with the JQuery datepicker, I hate their date picker because it calls another window and It's kinda ugly. (Sorry I can'...