javascript

Facebook javascript in address bar, possible to replicate?

This is my first experience with stackoverflow and I'm afraid my question asks of a lot for a first. I was looking at this thread: http://stackoverflow.com/questions/2634159/javascrypt-in-the-adress-bar-is-this-malicious and as you will see SLaks has very kindly deobfuscated the javascript and left us with what appears as the Javascript ...

Why does Printing from Javascript in Air happen out of order?

I am trying to print from an Adobe Air App that embeds an AJAX app. The print function looks like this: function printPage() { asyncSetupForPrint(printCallback); } function asyncSetupForPrint(printCallback) { synchronousMethods(); if (printCallback) printCallback(); } function printCallback() { var pjob = new window.runtime.f...

jQuery + Simple Dialog

Hi, I have a jQuery Model windows which contains a form. On creating of the page, I'm able to see the fields although in my dialog, i have set autoOpen to false. All the forms are in a div. a sample of my dialog looks like this: $("#dialog-form").dialog({ autoOpen: false, height: 460, ...

Is it possible to create a hidden property in javascript

I want to create an object with a hidden property(a property that does not show up in a for (var x in obj loop). Is it possible to do this? ...

Javascript links open in same page

How do i use Javascript to load content on the same page without reloading the entire page, ...

window.href open new window?

hi when ever i use window.location.href=//some url it always open a new window, this only happens when the parent window is an dialog box. Any idea what i did wrong? i tried using window.open("http://asdf.com", "_self"); as suggested on this thread http://stackoverflow.com/questions/1678155/window-location-href-opens-another-win...

Iframe auto-height not working when page changes in IE

I have an iframe in a page, with the following auto-height script. function autoHeight(e) { if ( e.contentDocument ) { e.height = e.contentDocument.body.offsetHeight + 35; } else { e.height = e.contentWindow.document.body.scrollHeight + 35; } } document.domain = "example.co.uk"; var ifr = document.getEle...

Combining multiple jQuery functions

Is there any way to combine all of this to reduce the amount of js? This is just an example of some of the jquery dialogs I have in my site, there are a few more too. Thanks. //initiate Search refinement dialog here $("#chooseMoreCnt, #chooseMoreCat, #chooseMorePr").dialog({ bgiframe: true, autoOpen: false, width: 500, ...

How to calculate the latlng of a point a certain distance away from another?

To draw a circle on map I have a center GLatLng (A) and a radius (r) in meters. Here's a diagram: ----------- --/ \-- -/ \- / \ / \ / r \ | *-------------* \ A / B \ ...

PHP is not called properly in IE using set interval function in Javascript

Hi all, I am trying to show the message updated in DB using the following code var showtime = setInterval('redirect()',5000); ////Redirecting to DB Status ///// function redirect() { xmlhttp = GetXmlHttpObject(); if (xmlhttp==null) { alert ("Browser does not support HTTP Request"); return; } var url="isResult...

Jquery UI modal dialogs

Hi All. I have a problem with Jquery UI modal dialogs. I have modal dialog (dialogA), which can create another modal dialog (dialogB). After the second creation and closure of the dialogB the overlay of dialogA disappear. Here is my code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/x...

How to drag items between 2 sorted lists with jQuery?

Hi - I'm trying to implement drag/drop/sort between 2 list elements: <ul id="first"> <li>item 1</li> <li>item 2</li> <li>item 3</li> </ul> <ul id="second"> <li>item 4</li> <li>item 5</li> <li>item 6</li> </ul> Basically I just want to be able to pass items between the lists and sort the items in each list. What's the simp...

How do you make javascript code execute *in order*

Okay, so I appreciate that Javascript is not C# or PHP, but I keep coming back to an issue in Javascript - not with JS itself but my use of it. I have a function: function updateStatuses(){ showLoader() //show the 'loader.gif' in the UI updateStatus('cron1'); //performs an ajax request to get the status of something updateStatus('cro...

What's faster DOM Insertion or Manipulation?

Hi all, Am I better to move a node I sent down form the server or to insert it? I'm using jQuery (1.4) but would like to know for both jQuery and JS in general. In this case the node is small with only one child. But what if it were a large list? What large list 1 = 200 li nodes large list 2 = 1000 li nodes Example: Insertion: <d...

Jquery galleria - make the first image in the gallery appear automatically

I've added the excellent galleria-plugin to a website I'm working on. However unlike the demo, I've been unable to make the first image display automatically on page-load. Currently, you have to click an image, before one will appear, after that everything works as expected. And yes, I've tried setting the class of the first image to "a...

Need a function in javascript to swap 2 elements in an array

A program to swap two numbers /* /* Function to swap two numbers. Function takes an argument which is an array of two elements. Function returns a new array containing the same two elements as the argument array but in reverse ord...

YUI DataTable with JSON and client side filtering Data Error

Hi, I don't understand what I'm doing wrong here ! I keep getting a Data Error. But I validated the JSON and it's ok... Here is the javascript from the YUI Datatble example (slightly modified). <pre class="prettyprint"><code> <script type="text/javascript"> YAHOO.util.Event.addListener(window, "load", function() { //var Ex = YA...

Google Maps: How to move zoom controls?

How can I move the Google Maps zoom controls, via the API, to the opposite side of the map? A mockup image is below: ...

Send 3 text box values to a server-side method with jQuery ajax

Hi, I want to send three text box values to server using jquery ajax. problem is that, i dont know the exact syntax to send three data. When i try sending one data(also change no.of parameters to one at server side method), its going good but when i try to send three text box values, its giving jquery error:"Internal server error". I thi...

Sharepoint: Combining Javascript files stored in "Style Library"?

For the sake of client-side performance, it's best to minimize the number HTTP requests to load a page. Is it possible to combine the contents of all Javascript files stored in the "Style Library" such that the client only has to make one request instead traditionally, a request for each Javascript file? ...