javascript

javascript parallelism

Well, first I want to say I'm a bit new in the world of Internet dev. Anyway, I'm trying to know if its possible to run two pieces of code in parallel using javascript. What I really need is to call two methods that are in a remote server. I pass, for both, a callback function that will be executed soon the data I want is ready. As t...

Openfire fastpath chat causing site to load slowly

We are adding openfire fastpath chat to our site. It will determine and indicate when live chat is available or not and display an appropriate image to indicate the current status and links for each state. The javascript call hit's a function that is on another box and this function uses document.write to output the html to the page....

Security-dangers when using anchors instead of submit-input.

I'm currently working on a site where I use anchors to submit forms with jQuery like this: $("a[title=submit]").click( function(){ $(this).parents("form").submit(); }); }); However I've read that using links this way is bad practice, security-wise. Does anybody know what the issues are? ...

jQuery Facebox delay

I need a very FAST and lightweight jquery based Modal box on my site, I am looking at Facebox http://famspam.com/facebox It is a nice plugin and it seems fast and lightweight but I think I can still strip out some of the features I do not need. For example I do not need it to use regex and find photos, so I have removed that part of...

Comparing large numbers with javascript

Can anyone tell me how to compare large numbers in javascript? Something like var sla = 1263293940000; var resp = 1263296389700; if(sla > resp) { //do something } ...

Get website's favicon with JS

Hello ! I am wondering if it is possible to get a website's favicon by an URL with JavaScript. For example I have an URL http://www.bbc.co.uk/ and I would like to get path to favicon described in <link rel="icon" .../> meta tag - http://www.bbc.co.uk/favicon.ico. I have many URLs so that should not load every page and search for li...

Submitting forms on enter/return when using anchors as submit-input.

I'm using anchors to submit forms: $("a[title=submit]").click( function(){ $(this).parents("form").submit(); }); It works very well, however I still want the user to be able to submit the form when pressing enter or return. Anyone know how to do this? ...

Styling select element (jQuery)

I tried some plugins but they all come with their own styling which takes quite some time to get rid of. Is there any plugin with minimal styling (or a really simple way) to apply custom background to select element? I just need something very simple. Thanks ...

Determine Pixel Length of String in Javascript/jQuery?

Is there any way to determine the pixel length of a string in jQuery/JavaScript? ...

Build, syntax-check, parse and evaluate a query.

Hi, I am building a query in a textarea with different conditions selected from the html controls. Also users are open to do modification to it. Client side: For the below list of condition: a(1, 3) > 20 b(4, 5) < 90 c(3, 0) = 80 I form a query: a(1, 3) > 20 and b(4, 5) < 90 or c(3, 0) = 80 On the server side this has to be parse...

Is it possible to call a server-side event on a parent page when a child page closes?

I have a parent page with two data controls. I want to be able to open a child window, do something on it, and when it closes I want to rebind only one of the two data controls on the parent page. I have the control I want to update within an UpdatePanel so would like to call rebind it and call UpdatePanel.Update(). ...

iFrame Navigation controlled by JS

I'm using javascript to control the href= field of the iframe located within the page. I am currently using function DoIFrameNav(object_URL) { document.all.additionalText.src="iframeContents.php?id="+object_URL; selectedEvent = object_URL; }//end DoIFrameNav to perform this action. And onclick=\"DoIFrameNav...

Click Toggle (jQuery)

$("li").hover( function () { // do x }, function () { // do y }); .. thats for hover, how would I do the same for click toggle, i.e do x on click and y on second click? Manythanks ...

DOM Insertion: Are some tag types faster when inserting into DOM?

Hi, I have a web page that used client side templating to update part of the page based on json obtained via an ajax call. At the moment I'm using an unordered list where inside each Li I have markup to display information about a product. I'm interested to know, are some tags faster when inserting into the DOM than others? That is to...

Returning false on link click jquery

Hi, I wish to have a link which opens popup when clicked however I wish it to open a page in a new window if the user doesn't have JS enabled. The following doesn't seem to work, <a id="tac-link" target="_blank" href="tac.html">terms and conditions</a> function popUp(URL) { day = new Date(); id = day.getTime(); eval("page" + id +...

Catching the specific javascript code being executed onClick

I am working on a site that has loads of legacy javascript and jquery includes and there is no documentation to show what is happening when. I have a specific problem to fix and I cannot find the relevant code that is being executed when a button is clicked. To save me from trawling through (and making sense of) hundreds of lines of leg...

Javascript onchange different in IE and FireFox

When this onchange event in IE returns false, IE focus stays on that input box. In Firefox the focus always moves to the next field regardless. HTML: input name="seminar_donation" type="text" id="seminar_donation" onchange="return CheckTotal(this);" JavaScript: function CheckTotal(inputbox) { if (isNaN(parseInt(inputbox.va...

OpenLayers, Mapserver & Tilecache

Hello, I would like to improve the performance of my application that displays thematic maps using OpenLayers, Google Maps & MapServer with TileCache (http://tilecache.org). Therefore I followed the installation instructions and installed TileCache successfully. Within my application I have the following code to embed a new layer on to...

onmouseover javascript opacity for IE8 and IE7

This is what I have so far: <img src="images/test.jpg" class="black" onmouseout="this.style.opacity=1; this.filters.alpha.opacity=100; this.style.filter='progid:DXImageTransform.Microsoft.Alpha(Opacity=100)" onmouseover="this.style.opacity=0.3; this.filters.alpha.opacity=30; this.style.filter='progid:DXImageTransform.Microsoft.Alpha...

jspx script element on GlassFish v3

The .war is served from GlassFish v3. I am trying to include a javascript file from my jspx. <script type="text/javascript" src="/base/interface/Service.js"></script> I get the following in my http response <script src="/base/interface/Service.js" type="text/javascript" /> The problem is that it should include the </script> tag. I...