javascript

Ajax data update. Extjs

hi there I need to keep certain data ( in a grid) up to date and was gonna do a poll to the server every 15 seocnds or so to get the data and refresh the grid, however it feels a bit dirty ( the grid will have the loading icon every 15 sec..) doesnt look great... Another option is to check if there is new data and compare the new data ...

Can I have a click and keyboard handler for RaphaelJS' canvas events?

Hi, I am new to RaphaelJS. I am trying to add click listener and keyboard listener to the canvas with no success. Can someone please explain how to use click listener and keyboard listener on Raphael. A small example will be of great help. Thank you. ...

Using seek() in Flowplayer with an FLV file

Is it possible to use Flowplayer (flowplayer.org) and the seek() function with an FLV file? I'm not streaming. ...

How can I ensure that changes to a form DOM are complete before POSTing?

Currently I have a race condition existing in my JavaScript code. What I am trying to do with this code is convert all check boxes which are a part of the 'checkbox' class and are not checked into text boxes with a value of zero. Currently when you post a check box that is not checked it does not appear in the $_POST data. However I need...

JavaScript - Regular Expressions

Hello, I have an HTML page with a text box. This text box has an id of "myTextBox". I am trying to use a regular expression in JavaScript to replace certain values in the text box with another value. Currently, I am trying the following function replaceContent() { var tb = document.getElementById("myTextBox"); if (tb != null) { ...

jquery nice form

jquery .dialog() will create a nice floating box form. if i do not want floating box form but just typical form on the page. what jquery function should i call? ...

Javascript syntax for objects in jquery

I am trying to enhance my page with a jquery right mouse menu, but am having trouble building the correct structures to populate it easily. Currently my page contains (among other things) a list of items for the user to review. (an html table) Based on the users role, and the current state and context of the row, the user may take one o...

Why does the hover style not work on the leaf nodes of jQuery Treeview?

If you look at Sample 1 on this page, you will see that, when you hover over the folder entries, the text turns red, but not if you hover over the leaf entries. I would like the styling for the leaf entries to work the same way as the folder entries. Each branch of the tree is an unordered list. The leaf entries are list items <li>. ...

jQuery: Foreach element href?

Hi, The title sounds confusing.. but im sure this is possible! I have one button, (id='downloadAll') and many <a href="..." class="link"></a> on my page. What i want to do, for the purpose of finding out how to do this.. is to do something logic like this. var hrefs = ALL OF THE ELEMENTS WITH CLASS 'link'; foreach(hrefs){ alert(this.a...

Calling Applet function from RegisterStartupScript

What I'm trying to do is call a Java Applet method immediately after PostBack of an ASP.NET page. In order to accomplish this I'm using the ScriptManager.RegisterStartupScript function which I pass a small script block to call a function in the page that then calls the Applet function. It seems multi-step but I get nothing if I just tr...

Is there anything inherently dangerous about instantiating a dojo class like this?

I need to be able to instantiate an object of a class in Dojo at runtime and mix it into another object (kind of like specifying an extends or an implements in Java, but at runtime). and I came up with the following solution: var declaredClassBackup = this.declaredClass; // backup the "declaredClass" var mixinObject = null; try { ...

Chrome Blocking Javascript, Google Wave, Google Gadgets

Project: Developing a gadget template for Google Wave which will allow my Flash movies to interact with the Wave api. I had to adapt the existing Flex application so that it would work with ActionScript. This was a success. Problem: Chrome v4.0 is blocking the load and/or execution of javascript files linked to in the Gadget's XML file....

SHDocVw insert element in document.body?

Hi, I am trying to inject html and js into an IE from a bho. To get the body I use: Code: public static SHDocVw.WebBrowser webBrowser; HTMLDocument document = (HTMLDocument)webBrowser.Document; IHTMLElement body = (IHTMLElement)document.body; My idea was to use body.appendChild but that will only work for the webbrowser control and no...

Javascript: Open 1+ links (that dont have content)

HI, This makes no sense, but for example if i downloaded a file to your /Downloads folder and i wanted to run file:///.../Downloads/myfile1.txt i could just go: window.location = "file:///.../Downloads/myfile1.txt; But if i had say 10, or it was generated by a script.. how could i do effectively this.. open ...myfile1.txt => ...myfile...

In JScript, is it possible to implement getters and setters that look like object properties from the outside?

While trying to port and generally playing around with some non-browser code, I came across getters and setters that looked like normal object properties. Something like this: js> var o = { a: 4, get b(){ return this.a + 3; }, set b(val){ this.a = val - 3; } }; js> o.a 4 js> o.b 7 js> o.b=10 10 js> o....

Javascript: enable/disable button with mouseover/mouseout help

Ok..this should be pretty straightforward: <input type="button" name="test" id="test" value="roll over me" onmouseover="this.disabled=true;" onmouseout="this.disabled=false;"> if i mouseover this button, it gets disabled..yay! But now when I mouseout, it doesn't get enabled...boo. I understand the concept of disabling it means you can...

Limit JS and PHP abilities inside an IFRAME

We have a business partner that is IFRAMEing some data to one of our web pages. I would like to limit his JS abilities to interact only inside of the IFRAME as well as his PHP abilities. Is this something that is setup automatically or do I have to make sure that these capabilities are assigned somewhere. Thanks for the help. ...

How to center Google Map on a country by name

I'm using the Google Maps API (v2) and would like to center the map onload to a country (for example england). At the moment i center the map using: map.setCenter(new GLatLng( 43.907787,-79.359741), 9); But this obviously requires longitude and Latitude. Any way to do this by inserting a name of a country? ...

How to fix Array indexOf() in JavaScript for IE browsers

If you have worked with JavaScript at any length you are aware that IE does not implement the ECMAScript function for Array.prototype.indexOf() [including IE8]. Not a huge problem because you can extend the functionality on your page with the following code. Array.prototype.indexOf = function(obj, start) { for (var i = (start || 0...

parsing xml in javascript

I need to create custom objects based on an xml input, the rule is that for every node, if it has a direct child node is named EndNode and the text value of which is 1, then I create a leaf object. So for every node, I need to check the direct child with name EndNode and its value. It's not so easy with the Dom API. and Dom selector(in...