javascript

Show AJAX content after images have loaded

I am developing my own lightbox kind of jquery plugin. Everything works but I want to hide the loaded content until the images have loaded in the browser from the AJAX call. I found a similar post and I am using the following script but the setTimeout function is what reveals the content and not the .load function. Am I trying to achie...

How to receive ajax request using django?

I have the following JQuery Ajax request on my template that i want pass to my django view, function loginUser(){ $.ajax({ type:"POST", url :"/login-user/", data:"title=ajax call", datatype:"json", error:function(data){alert('Error:'+data);} success:function(dat...

Observing events on injected elements using prototype

I asked a question previously, it was answered correctly in the form i asked it but realised now why it wasnt working for me. i have this code to observe multiple select menus: $('product_options').select('select').invoke("observe","change",optchange); This does work - as pointed out - with static layout like this: <html> <head>...

Coda slider not working inside Tabbed Ajax

I included the full page that has Coda slider (including header and scripts) inside a tabbed ajax script, but it failed to load ! link below. Is it not possible to have two java scripts load in one page? Thanx Web site here P.S. I asked the question in another post, but I got an answer that fixed things partially so I thought by accept...

Instantiating Ext.form.CompositeField

Why can't I instantiate an Ext.form.CompositeField in extJS? Firebug tells me "CompositeField is not a constructor". My code: var f = new Ext.form.CompositeField({ labelWidth: 120, items: [ { xtype : 'label', fieldLabel: new_attr_name, }, { xtype : 'label', fieldLabel: new_attr_display_name, ...

Javascript CS-PRNG - 64-bit random

Hi, I need to generate a cryptographically secure 64-bit unsigned random integer in Javascript. The first problem is that Javascript only allows 64-bit signed integers, so 9223372036854775808 is the biggest supported integer without going into floating point use I think? To fix this I can use a big number library, no problem. My Method...

window.open on load page (ASP.NET) using Method=POST

i need open pop up in asp.net using post Method and window.open to rezise te new windows. my code: Open the pop up: function mdpbch(URL) { child = window.open(URL, "passwd","dependent=1,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=600,height=475"); child.location.href = URL; if (chil...

jQuery innerHTML does not work properly (!)

I was trying to build an <a> tag and set it in a <td> of a table. The string is built perfectly but when I set this as the innerHTML using jQuery, the string gets broken. I can't figure out why this is happening? Any clues? Here's the string I want to set in the <td>: <a onclick='return EditIssueItemBatch('1c1e27a2-beac-4772-a26f-6a7e0...

How to output integers with leading zeros in JavaScript

I can round to x amount of decimal places with math.round but is there a way to round left of the decimal? for example 5 becomes 05 if I specify 2 places ...

Partially select text inside text field

I want my script to select just a part of the text inside a text field (<input type="text"). How can I do this? ...

Firefox shows apache 2 test page, while internet explorer works just fine

When I am trying to access Topspeed.com, my internet explorer shows the page just fine, but if I try firefox then I end up on the apache 2 test page... any idea why ? ...

Trouble using 'eval' to define a toplevel function when called from within an object.

I've written (in JavaScript) an interactive read-eval-print-loop that is encapsulated within an object. However, I recently noticed that toplevel function definitions specified to the interpreter do not appear to be 'remembered' by the interpreter. After some diagnostic work, I've reduced the core problem to this: var evaler = { ...

IE Script Error/JQuery Cycle

I am working on a site and it works/looks great in Safari, Firefox, Chrome and IE8. For some reason when testing it in IE 6 and 7 the jQuery does not work (the images are there but static) I get the following error message: Internet Explorer Script Error. Line: 38 Char: 1 Error: Expected Identifier, string or number Code: 0 Can some...

Adding elements to dropdownlist through javascript

Am unable to add elements to a dropdown list via Javascript. The below piece of code works in IE and Chrome, but not in firefox. ddlId.add(new Option("",0)); In firefox, I keep getting an 'Not enough arguments' exception. Any idea on how to resolve it? Thanks ...

Facebook select friends and post UIDs to custom URL

I'm building a facebook connect application, and here's the specific use case I'm trying to solve (using the Facebook Connect Javascript toolkit - http://github.com/facebook/connect-js) There is a link on a page that a user clicks to "invite friends". This click opens up a facebook friend selector widget (something like the multi-frien...

IE+jQuery+Ajax+XHTML: HTML getting clipped after .html() or .innerHTML

This is a really hard problem to put into a brief sentence, so I apologize if I kill it. I launched a site recently which had been extensively tested on my local web server on all my desired browser platforms, including IE8 (IE8 standards mode, XHTML Strict). I encountered no problems at all until the site went live on a dedicated web ...

Get table row based on radio button using prototype/javascript

I have an html table that has a name and a radio button like so: <table id="cars"> <thead> <tr> <th>Car Name</th> <th></th> </tr> </thead> <tbody> <tr> <td class="car">Ford Focus</td> <td><input type="radio" id="selectedCar" name="selectedCar" value="8398"></td> </tr> <tr> <td cl...

Loading an XML file with todays date in the filename... need to fallback to old file if one with todays date doesnt exist..

So here is my question. Using javascript/jQuery I am currently loading in an XML file that has a file name such as carousel_large_2010-06-08.xml.. the way I am doing it is checked for todays date then grabbing a file that has that date in the filename... the issue is sometimes they wont be uploading a new file for a given day so it needs...

Javascript passing value to open window

Hi! How do i go about passing the value of width ,height,resize received as parameter to window.open using javascript? Thanks Example function poponload(mywidth,myheight,resizeVal) { testwindow = window.open ("http://www.yahoo.com", "mywindow","location=1,status=1,scrollbars=1,width=+mywidth+,height=myheight,resizeVal"); testwi...

Retrieivng coordinates in this page

Hey guys, Im trying to do some data mining and analyze data based on locations. For this site, http://www.dianping.com/shop/1898365 I am trying to figure out whats the latitude and longitude by crawling. But I cant seem to figure out where this information is stored. Can someone give me some pointers ...