How might I extract the number from a number + unit of measure string using JavaScript?
If I have this string str = "22px"; How do I extract just the number 22? Thanks. ...
If I have this string str = "22px"; How do I extract just the number 22? Thanks. ...
I've come up with the following function to fill a need: function getTabFromElementID(elementID){ //get all of the tabs from the tabViewObject var tabArray = this.get('tabs'); var foundTabObject = nil; tabArray.each(function(tabObject, index){ if(tabObject.get('element').id == elementID){ foundTabObject = tabObject ...
I am building an extensible window control in JavaScript and intend to use two boxes as follows: <div id="outer"> <div id="inner"> content goes here... </div> </div> The CSS for this would be as follows: #outer { position: absolute; top: 20px; left: 20px; height: 200px; width: 200px; } #inner { ...
I use the following code to slide out a div on a mouse-over, wait a couple of seconds and slide the div back. $(document).ready(function() {$("#divider").mouseover(function () {$("#slider").show("slide", {direction: "left"}, 1000).pause(2000).hide("slide", {direction: "left"}, 1000);} );} ); I'm sure this is simple, bu...
i need to have some php code inside javascript <script ...> <?php echo " ... "; ?> </script> but this doesnt work. how can u implement php inside javascript that is in a own file javascript.php? ...
So I'm having a crossbrowser javascript issue. I've got a <select> dom element that has some descendent <option> element with selected=true. In Firefox, I can just do select_elt.value to get the value of the selected option, but this seems not to work in IE6 (which I need to support). I tried to iterate through the select_elt.getEleme...
Here's my HTML: <input id="test" type="checkbox" checked=""> Here's a Firebug excerpt: >>> test <input id="test" type="checkbox" checked=""> >>> test.checked = false false >>> test <input id="test" type="checkbox" checked=""> Um...am I missing something, or should that last line not read the following? <input id="test" type="che...
hello, I've seen there's a lot of libraries that will allow me to output shapes and lines but do these libraries allow for freehand drawing using the mouse? I want to allow users to draw and then to save their work to database. Is this possible? Thanks in advance! ...
I am using dijit.form.FilteringSelect to provide a way to select values from a . The problem is, when using dojo, the label is returned instead of the value of the s. For example: <select name="test" dojoType="dijit.form.FilteringSelect"> <option value="1">One</option> <option value="2">Two</option> </select> Dojo is returning the lit...
How could I set a Flash (Actionscript 3) variable using javascript? Or is it possible to call a flash function with parameters from javascript? I have tried document.getElementById('flash').SetVariable("data", "asdf");but it only works in AS2 and AS1. ...
Hi, The lines below work in IE, what do I have to do so that it works in the other browsers? document.body.onmousedown = ContextMouseDown; document.body.oncontextmenu = ContextShow; Thanks, R. ...
Has anyone written an open source XMPP library that uses WebSockets and is meant to be run by a browser? ...
I want to convert strings to lower or upper case in JavaScript in the locale I wanted. I think standard functions like toUpperCase() and toLocaleUpperCase() do not satisfy this need. toLocale functions do not behave as they should. For example in Safari 4, Chrome 4 Beta, Firefox 3.5.x on my system it converts strings with Turkish charact...
I've been using Jint to run server-side JavaScript code and I'm liking it a lot so far. The one issue I'm having is debugging. JInt exposes events that can fire when a statement is executed or a breakpoint is hit. As mentioned on the Web site, it would be possible to create a visual debugger that works through this mechanism. Before ...
Hi, i have a form, that because it has a upload file, i had to switch from ajax to iframe post to emulate an ajax. The problem is that it has a component with lowpro to hide and show a button with onmouseover and onmouseout. Everything work fine. The problem is that after that i submit the form, with iframe, after the page reload, the ...
I am trying to make a horizontally scrolling Web Page. This template uses J Query and CSS to control width, but the User still has to drag the scroll bar across the bottom - how would I add arrows or something that the User could just click on and it would go over to the next section? Thanks in advance for your help! http://css-tricks.c...
I am trying to reference a javascript function in a .js file loaded in my main page from an iframe using the 'top' variable. It works in FF, Safari, and IE6 but not in IE8. The snippet is (assigned to onmouseover): top.set_image(this, 'images/login_h.png') Where set_image is my function. The error is "Object does not support t...
Possible Duplicates: Best reference sites for HTML and JavaScript programming What is the best online javascript/css/html/xhtml/dom reference? What english-language online resources do you use as a reference on HTML rules, tags and elements, and real-life compatibility information (IE 6 on Mac renders tag X only if the doctype...
I'm developing an ajax heavy web app, and would like to have textarea's (with class="ui-richtext") automatically initialize TinyMCE. This is easy for textarea's that are loaded normally, but how about for content that is loaded AFTER the fact using ajax? I was thinking something along these lines: (i'm using jquery) $("textarea.ui-ric...
How does one convert the following to seconds in JavaScript? mm:ss.sss ? What is the .sss? ...