javascript

Use a specified javascript engine?

Is it possible to use your own javascript engine in place of the browser's engine? We have a cloud based JAVA app and uses a lot of javascript and ajax. I don't know a ton about Java (just enough to get by), I'm an ajax programmer. Mozilla has a javascript engine called rhino. Is that engine only for running javascript inside a native...

div nested inside a gives weird innerHTML result in FireFox

In IE 8, jQuery acts as I would expect: >>$('div',$('<a><div></div></a>')).html('test').html() "test" In FireFox: >>> $('div',$('<a><div></div></a>')).html('test').html() "<a>test</a>" It puts anchors around what I wanted. Does anyone know why this would happen? EDIT: Setting this with plain javascript (i.e. setting innerHTML) cau...

How does one properly test a javascript widget?

So, I've written a little javascript widget. All a user has to do is paste a script tag into the page, and right below it I insert a div with all of the content the user has requested. Many sites do similar things, such as Twitter, Delicious and even StackOverflow. What I'm curious about is how to test this widget to make sure that it ...

jQuery, Proper context for window.open

I am trying to load a web page in a new window on class="link" Below is what I have but it does not seem to work in IE 7-8 $('.clicky').mousedown(function(){ window.open("http://google.com"); });​ Here is the complete context http://jsfiddle.net/Zw5c2/14/ Foolish me it was my pop up blocker. But I modified the scrip...

ajax web app : possible to force bookmarking without url's hash-string?

I have a single-page ajax powered web app, however the way my app works is if a hash string is in the url it will load that element which is really useful for people to link to content on it. When it comes to bookmarking/favouriting things are different. My users want to book mark the app and not the current bit of content (hash string)...

javascript undefined error from form input radio button

I have a pop up window which lists images using a form and radio buttons. When i click a radio button, the function is called which should pass back to the parent window. I keep getting 'undefined' as the value which means to me that the variable hasn't been set. How do i get around this error? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTM...

Native Javascript Class implementation

Hi, I am involved in a web application project at the moment and we are not going to be using a framework. I am looking for the 'best' javascript inheritance implementation. I have worked with prototypal style classes as follows: function animal(options) { self = this; //properties this.name = options.name; //eve...

Build a JS server inside of Java for Google AppEngine

Hi, I just needed to create a little interface for a project. So I decided to take given code and to run it on Google AppEngine. My problem is, that I'm experienced in JavaScript and got some basic knowledge of Java, but I got no clue how a Java webapp has to be structured. I started Eclipse and installed the AppEngine-addon, downloaded...

LABjs conditionally loading scripts

Hi, I would like to start incorporating LABjs into my project but I want to know if there is anyway to conditionally load scripts. For example, something like: $LAB .script('framework.js').wait() .script(function(){ if(es){ return 'es.js'; }else{ return ''; } }) I have not tried thi...

jQuery getting the margin-top needed to put element on the top of the screen

I've got a problem in internet explorer 6 and FF with something I'm trying to implement in jQuery. Basically there is an object at the top of the page using floated content that seems to be interfering with the $(window).scrollTop() property. It was my understanding (and if I'm wrong, please help me by telling me the right way!) that $...

searching number in body using jquery

i am trying to search all numbers (of digits 8) in body using jQuery, its only returning first no. in body? var myRe = /[0-9]{8}/; var myArray = myRe.exec($('body').html()); alert(myArray); ...

How to free memory after an Ajax request

Hello, I have a very basic ajax slideshow on my website. On every scroll, the new images and response content continually increase the amount of memory used by the browser. I've done my research and tried all suggestions to reset the XHR object on each new request, but this does absolutely nothing to help. The slideshows are basic bu...

add javascript into a html page with jquery

Hi everybody! I want to add a javascript google ad but I can't insert the javascript into the div using jquery. I try to simulate my problem with this test, which is using some advice I found on stackoverflow , but it does not work. I want <script type='text/javascript'>document.write('hello world');</script> to be inserted in the div,...

Mootools Div overlay

Hi, could someone maybe give me a small hint on how to do this with mootools. Basically i have a div like <div id="center-panel" style="height: 200px; width 200px; background: green;"></div> i basically want this div tag hidden by default, and then once the user has been on the website for like two minutes i want the div tag to displ...

can you give example for using php in flex application ?

How can wirte php script in flex application ? . at the same time this script can be asp.net,javascript ... ...

Prevent Venkman (aka JavaScript Debugger) from printing to the console via window.dump()

The Venkman addon (officially called JavaScript Debugger) likes to print lots and lots of information using window.dump (or at least I assume that's what it's using since I don't know any other way to print to console). I would like it if the console contained only the output from my code, and not all the output from Venkman. I don't min...

How to use Google Analytics to track downloads?

I have a website where I have .tar.gz, .zip and .dmg files. I need to track the number of downloads using google analytics. I heard that I can use onclick="pageTracker._trackPageview('/file_name.file_extension') for the "a" tags on the page. I'm not clear what the file_name.file_extension corresponds to. Also, do I need to use some addit...

JavaScript/jQuery onmouseover problem

Hello, I want that when mouse is over an image, an event should be triggered ONCE, and it should be triggered again only after mouse is out of that image and back again, and also at least 2 seconds passed. My current function is called continuously (refreshcash) if I leave the mouse over my image <img src="images/reficon.png" onmouseove...

jquery screen size alter filename

Hi I'm struggling in getting the end bit of this jquery correct and I'm not sure if it'd work - want to add to a image filename if the screen is a certain size here's the code <script type="text/javascript"> $(document).ready(function() { if ((screen.width>=1024) && (screen.height>=768)) { var re = new RegExp("(.+)_hover\\.(gif|...

How to turn a html form into a complex JavaScript object

Is there a way to turn a form into a complex JavaScript object based some structured form? Now, I have no idea if this should be done in a better way, but basically I want something like this: <form> <input name="Foo" value="1" /> <input name="Parent.Child1" value="1" /> <input name="Parent.Child2" value="2" /> </form> and I...