javascript

Javascript cache

Hi all, I need to get a large amount of data back from a server via ajax. It will take a bit of time to get to the browser. The second time the user goes back to same web page I don't want them to have to download the data via ajax again. Is there anyway Javascript can write the json data to the browsers cache or filesystem reliably? C...

What options do I have for a Simple Datastore Webservice?

Hi folks, I have a simple web based app that's going to run on an iPad. What I need is a way to store user inputs: email and lat/lng from a Google Map. I don't really have access to a serverside setup at the moment. It needs to be fairly secure as I can't give out the users email obviously. I would like to be able to post from my web a...

Django/python is converting my post data from JavaScript

When I post a JSON string to Django by Ajax, it converts it into an invalid JSON format. Specifically, if I look in the post data in Firebug I am sending: info {'mid':1,'sid':27,'name':'aa','desc':'Enter info' } Yet when I access it in the django request I am seeing: u'{\'mid\':1,\'sid\':27,\'name\':\'aa\',\'desc\':\'Enter Info\'}...

What are the implications of node.js?

Hey guys, I've been reading about node.js lately. I've seen many articles about how it's really great and all from some prominent people. Given the inertia that this project seems to have, and that I am currently learning javascript and jQuery, the project has gotten my attention. I get that many people are excited about it, but I don't ...

Detect script defer support without testing

Is there a reliable way of detecting if a browser supports the <script> attribute "defer" without testing? I'm not interested in creating multiple script blocks both defered and not and seeing which executes first. I'm looking for legitimate feature detection. "defer" in document.createElement("script") returns true just about everywhere...

How can I make a regular expression which takes accented characters into account?

I have a JavaScript regular expression which basically finds two-letter words. The problem seems to be that it interprets accented characters as word boundaries. Indeed, it seems that A word boundary ("\b") is a spot between two characters that has a "\w" on one side of it and a "\W" on the other side of it (in either order), ...

YUI: specify fallback in case loading script from CDN fails?

Hey is there a way to specify a fallback js just in case loading from the YUI CDN were to fail? ...

AJAX and PHP data transfer

Well basically what im trying to do is create a method that can take any datatype and essentially convert it into php recognized data or JSON for that matter. So say i wanted to pass an array, a 2d array, or just some basic string. I would call this function pass in the parameters and sent it off to php. Now i would reverse engineer this...

Hashtables not really working.

Hi! I'm doing some web development, and I'd like to use an associative array in my code. I've used hashtables in other design work, and they definitely do the trick. However, when I try to call "var coms = new Hashtable();", I get errors stating that there is no class hashtables. I've read that in JS all objects ARE hashtables, so I su...

How do you change the color of the intial text in a text field using CSS?

And how do you make the text disappear when you click into the field and reappear when you click out of it? ...

what happens to javascript variable after a call to the server ?

I just began to learn javascript, so here is a silly question : What happens to a javascript variable after a call to the server? Are all the variables wiped out? I read somewhere that javascript variable in ajax can act like session or cookie. Is that true? ...

display:none to display:block - How do I get the page to scroll down?

I am using javascript to change the display of a div tag with an onclick event. The div is at the bottom of the page, when and/or if needed the user can open the div. How can I get the page to scroll down when this div is changed to display:block? FYI: I have tried var objDiv = document.getElementById("the_div_id"); objDiv.scrollTop = ...

How to use a javascript value inside html style property value

Hi, I have created some div(s) on a page. Depending on the browser (or may be any other settings) I want to change the width of these div(s). Now, if I embed style=" blah blah blah...; width:200px" inside div tag, its ok. But I want this 200px to be, say, 220 sometime or 230 or 240 other times. So what I want now to calculate my requir...

Run Javascript from Obj-C/C++ that interacts with Photoshop

Slightly related to my other question, how do I execute JavaScript from an Obj-C/C++ program on OSX? (I think JavaScript will allow me to do what I need to, even though AppleScript doesn't. According to the Photoshop documentation anyway.) I need it to be able to interact with Photoshop. ...

mouse over popup menu

Creating a website using simple html(not html5) and css but got stock in mouseover effect. Need to show some text with background image when user mouseover a link. Following is an example.. NORMAL: OVER: I don't think it is possible to create the effect with simple CSS. My question is what is the most effective way to create the ove...

How to get page source of page at another domain (in Javascript!)

I am trying to get the source page of a webpage on a different domain. I know this is easily done with PHP for example but I would like to do it in Javascript because I am getting results from a page and if I use a server-side language, the original website will block the calls since they come from the same IP. However, if the calls are ...

internet explorer problem with a javascript page

I have made a page The url here It works fine in ff/chrome But the whole login form and reg form are not displayed in ie and the shout box is not working in ie... Any help Thanks Pradyut India ...

Using Javascript to get what is currently typed into the url bar.

I'm writing a Firefox add-on and trying to get what is currently typed into the address bar, but every time I try, I get a null error. The code I'm using is var url = document.getElementById("urlbar").value; However, when I do that, the error I get is Error on line 1: document.getElementById("urlbar") is null`. I have a blank t...

Invoke C# code from JavaScript in a Document in a WebBrowser

I have a C# WinForms application that has a WebBrowser control inside of it. I would like to perform two-way communication between my C# form and the JavaScript within the embedded web browser control. I know I can invoke a JavaScript function with InvokeScript, but how can I invoke C# code from JavaScript in a Document? I guess it wont...

update sIFR text after ajax update.

I am using sIFR version 3 in my site. I am updating the text in a div with id 'points' from an ajax request. I want to update the text and apply the sIFR to that div after the text is changed. Please suggest a solution. here is my update code new Ajax.Request('score.php', { onSuccess: function(response) { $('points').update...