javascript

jQuery: How to make an AJAX request and continue without waiting for request to complete?

I want to make an AJAX request "in the background" of my JavasSript function, but my script waits for the AJAX request to complete before it continues to execute my code. $('div').hide(); $.get('/controller/action', { id: 'abc123' }, function(data){ //request completed //now update the div with the new data ...

jQuery help with checking parent of checked child checkbox

I have a main row and some other rows underneath that main row like this: [checkbox] Main heading row [checkbox] first child row [checkbox] second child row When I click on the child row, it should check the parent (main) row automatically. Problem is that it doesn't check it first time I click it. I ha...

Open MilkBox outside of an iframe

I have a page with content loaded in via iframe, and the pictures within the content area open up in MilkBox, similar to LightBox. Here's the URL so you can check it out: http://interplay2010.com/ Under the Media section, the pictures open up within the iframe. I would like the pictures to open up outside the iframe, but I have no idea...

record and retrieve html element / node path using javascript

Say I've selected a span tag in a large html document. If I treat the entire html document as a big nested array, I can find the position of the span tag through array indexes. How can I output the index path to that span tag? eg: 1,2,0,12,7 using JavaScript. Also, how can I select the span tag by going through the index path? ...

jQuery elements inside a jQuery dialog stop working after ajax call

Hello all, <div id="divItems"><div id="divItemsContent"></div></div> I think i know what the problem is, just don't know how to solve it. Here is the code: function SplitOrder() { var SplitTable = $.ajax({ url: 'AjaxActions/SplitTable.aspx?FromObjectID=' + $('#hidObjectID').val() + '&ToObjectID=' + ObjectID[1], as...

BindAsEventListener Problem in Prototype

var Generic_Large_Blue = new Element('div', { 'id': 'divZoltarSubmit_', 'class': 'Generic_Large_Blue Blue_' + placeholder }); var Generic_Large_Blue_Left = new Element('div', { 'class': 'Generic_Large_Blue_Left' }); var Generic_Large_Blue_Middle = new Element('div', { 'class': 'Generic_Large_Blue_Middle' }); var G...

Dynamically increase the size of a multi select drop down box

I've implemented this on mouseover and onmouseout like so: <select size="3" onmouseover="this.size=this.options.length;"> This is all well and good, except i don't want it only on mouseover, i want it always :) forever. Thanks in advance. ...

jCarousel infinity ajax load (browser compatibility?)

Dear all, I tried to use jCarousel to create a sort of image display gallery, it will first load a few images and then load some more dynamically when clicking "next" or "prev". Everything work fine in clicking "next" but it acting weird when loading ajax in clicking "prev" in working in chrome and IE 8. I suspect the problem would be ...

window.location.href but where the address bar changes

For some reason, using window.location.href doesn't change the URL in the user's address bar. Is there any reason why I'm getting this behavior? CODE Earlier, I posted to code here. But I see that I'm in a frame. For anyone who happens to have the same issue, window.top.location.href = 'page.htm'; will do the trick. PS. Apologies f...

jQuery: Why would selector fail?

<html> <head> <script src="../jquery.js" type="text/javascript"> </script> <script type="text/javascript"> $(".demo").click(function() { alert("JavaScript Demo"); }); </script> </head> <body> <p class="demo">a paragraph</p> </body> </html> Why did not the click function response? Thanks. ...

Building on top of Google Fusion Tables

How do you modify and build on top of Google Fusion Tables? I want customize the way that people can upload data, the way the data appears on the maps, and the results that search queries return. I know this question is general, but where should I start, and what should I look at first? (Don't tell me the fusion table documentation, beca...

[SOLVED] Are input->post arrays possible in codeigniter? I'm using doctrine and need to combine my birthday dropdown for db insert

I have just finished creating my signup form and now ready to insert data into the datebase using doctrine. Everything inserts fine but in my var_dump my birthday dropdown is in 3 seperates... day , month and year.. I would like to combine them and post as "birthday" into the db with doctrine. I wish to do this in my controller, please ...

js equiv of php's foreach($arr as $k=>$v)

Lets be clear, I'm not asking for for(var i in list) I want the key assigned to a variable as well. ...

Can't do an AJAX call with Python and Django

I am still learning to do javascript and django and yesterday I tried to do a simple hello world ajax exercise. Server logs show that python code is being called but somehow django/python does not return anything when I check the xmlhttp.responseText and responseXML in firebug. UPDATE: I removed the checking of the http status return...

How to select unknown numbers in javascript?

So for example I have: array(2,1,3,4,5,6,7) and I already know (2,1,3) How should I get (4,5,6, 7) if I know that all numbers exists from 1 to 7 and the numbers what I already know So I want an array with the numbers what I don't know yet. Sorry if sounds stupid :| ...

How to use getElementsByTagName() to find all nested elements?

I have the following HTML: <html> <head><title>Title</title></head> <body> <div id='div2'> <a href='#'>1</a> <div id='div1'> <a href='#'>2</a> </div> </div> </body> </html> ... and the following Javascript code, which I'm running through Greasemonkey: var nodes = document.body.getElementsByTa...

Meaning of SOP (same origin policy)

What is the real meaning of SOP (Same Origin Policy)? I know it means that the Javascript code from one origin cannot accuess resources from another origin. But what exactly does the word "resources" mean? For example: Javascript code can access IMAGES from another site. Javascript code cannot make ajax request to another side. ...

How to force a pop-up to open in a new window while (Always open pop-ups in new tab) is checked?

Currently, under IE8 and in IE7, using javascript window.open and target param is set to _blank, and while (Always open pop-ups in new tab) is checked, the pop up will open in new tab. Is there a way to force the new pop up to open in a new window from javascript? Is there a solution other than javascript? Thanks ...

How to get the item that appear the most time in an array?

var store = ['1','2','2','3','4']; I want to find out that 2 appear the most in the array. How do I go about doing that? ...

Convert json object to json string and use it's functions?

I have a json object with a function: var thread = { title: "my title", delete: function() { alert("deleted"); } }; thread.delete(); // alerted "deleted" thread_json = JSON.encode(thread); // convert to json from object thread_object = JSON.decode(thread_json); // convert to object from json thread_object.delete(...