javascript

How do you Javascript style area elements on mouseover?

I've got an image map w/ 20 area elements, only four shown below. I want to style each area so that a blue border appears whenever a user hovers over it - all the area shapes are rectangles. <map id="mymap" name="mymap"> <area shape="rect" coords="0,0,223,221" href="http://..." /> <area shape="rect" coords="226,0,448,221" href=...

How to use JSON2 in Node.js

I want to use json2 as JSON.parse in node.js, (forgive the stupid question) I can't quite figure out how to use it. I have a copy of json2.js, with the first line removed in my current working directory. Then, from the node.js shell i do: > orig_func = JSON.parse [Function: parse] > require('json2') { JSON: {} } > orig_func === JSON.par...

Which is the best client-side include technique ?

The ones I know: <iframe> <object type="text/html"> jQuery load XSLT (if available) ...

Child Window Reading Parent Windows in HTTPS

Hi, I have a parent window opening a child window through window.open. The parent window is on http www.abc.com and the child window is opened on http www.abc.com as well. I have a Javascript file on the parent window that the child window looks at to communicate. When the parent window is on http www.abc.com, both windows are communica...

Simulate No Flash in Ubuntu

I've searched this and cannot find it. I've tried different plugins and different browsers (Firefox, Opera, and Chrome). I've tried most of the no flash plugins for each of those as well as disabling Flash plugins/addons in the settings. I also renamed the .so file in /usr/lib/flashplugin-installer/ i found by searching the system. when ...

Javascript for generating month and year dropdowns

<script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript"> if(window.addEventListener){ window.addEventListener('load',setDay,false); } else { if(window.attachEvent){ window.attachEvent('onload',setDay); } } function setDay(){ document.forms[0].elements['mes'].onchange=function() { n= pars...

Javascript language constructs

I'm writing a Javascript syntax highlighter and I am not 100% I have everything. So far I have: Comments (// and /* */) Regex Number Highlighting Quotes (" and ') I also have keyword highlighting: if else new var function for return this do while true false Am I missing any constructs or keywords that would be essential to highl...

Flashdevelop issue with publishing

I have created a simple flash object to redirect a browser to a different webpage using "navigatetoURL" while getting the URL from externalinterface calls to the javascript that the page doing the embedding of the flash file has. I am able to build everything just fine and the html page I created (using swfobject.embedSWF to embed the f...

Displaying a progressbar or error message in a fancybox

Here is what I have in my member.php for my fancybox: <script type="text/javascript"> $(document).ready(function() { $("a#uploadpage").fancybox({ 'titleShow' : false }); }); </script> . . . <a id="uploadpage" href='uploadpage.php'>Change Image</a> <br/> This works perfectly, and...

Problem of serializing javascript object to JSON string.

My question is sort of stupid that why JSON.stringify({"annotation": [{"x":1, "y":2}, {"x":1, "y":2}]}) does not return {"annotation": [{"x": 1, "y": 2}, {"x": 1, "y": 2}]} but returns {"annotation":"[{\"x\": 1, \"y\": 2}, {\"x\": 1, \"y\": 2}]"} and how can I get the first output? ...

Cross-browser issues with contenteditable.

I have a DIV element with contentEditable set to 'true'. I wanted to create link elements inside this DIV, which needs to be deleted with a single backspace. I generate the link by replacing the text entered, when 'space' character is pressedI followed the suggestions given in http://stackoverflow.com/questions/2239821/backspace-doesnt-d...

Use html node from Javascript variable with jQuery?

I would like to use the attr() method on a html node, which I have a reference to in a normal variable in Javascript. Now, the problem is that this node is not returned by a jQuery selector, but with normal Javascript: var myNode = window.getSelection().getRangeAt(0).commonAncestorContainer; Now, I would like to do something like: jQu...

appendTo not working in jquery-ui 1.8

I have this widget and I am trying to append this.helper into my body. I used the $.extend() function at the end, but I don't know if this works in jquery 1.8 because I just updated to 1.8 and everything went wrong so I have been in the middle of trying to make it work. my this.helper does not get appended to my body. Can anyone help?...

SQLITE php javascript? auto refresh without entire page refresh

Hi all, I have a simple php code which prints data from a SQLite database. Basically $query ="Select A from B". This all works fine. & when the sqlite db updates, i can refresh the page & the new data displays. Want i am aiming to achieve is to refresh this data automatically every 5-10 seconds without having to reload the entire page....

Javascript scope help

I am relatively new to javascript so please be patient if what i am asking is completely stupid! I am trying to make a simple module. Inside the module i want to have a config object that holds settings for the module. I am also using jquery. The jquery selectors work only when in a function directly in the main object/module. I und...

JQuery : How to call an inside plugin function with a <a href> generated by another function of this plugin?

Hello everyone, I'm making a little widget for my site using a search api I just made. Briefly, I want to retrieve last posts or top rated posts. I've got to tabs for that. By default, on loading, I'm on recent posts. If I click on Top posts, I'd like to call a function inside my plugin that modify a var that tell to my search API to r...

How do I overlay JAVA onto a static image?

I am re-designing a website for a major University, and they use java images on most of their pages. How do I place/inlay a Java slide show onto a static image (ie: background image). (I know it is a weird combination of JAVA, CSS, and XHTML.) ...

Is there a dojo equivalent of jQuery address?

Hello, I'm trying to create an ajax app with dojo. Is there an equivalent or something similar like functionality to jQuery Address. I want to make ajax hash based url navigation like twitter, facebook, etc with dojo. regards ...

Onclick doesn't fire in IE when DOM element created via jQuery

So here is the jQuery snippet I am using to create a div that I want to click on $("#someID").after('<div style="cursor:pointer; text-decoration:underline; display:inline;" onClick="alert(\'It Worked\');">Details</div>'); This Works in FireFox without any problems its just IE that doesn't fire the event. The div is added right after ...

How to run JavaScript snippet right before onload event(Google Chrome Extension)

What I'm trying to do is write a Chrome extension that inserts a snippet of Javascript that will fire after all the Javascript code on the page has run, but before the onload event fires. (There is some code on the page that has an event listener for the onload event). I've tried all that I've thought of for my extension, but I haven't...