javascript

javascript subtract(-) keycode

ok, i need my code to check if minus/subtract/- was pressed, if it was pressed i want an alert box to pop. i tried with both 109 and 189 key codes but i still don't get the desired result. although i press "-" i don't get that alert box ...

How to achieve this advanced interface with jQuery?

I'm currently fighting a fierce battle with an interface I'm trying to put together. I'm pretty decent at CSS & XHTML, but my jQuery/JavaScript skills are not too impressive. What I'm looking for is not so much a strict answer, but some hints on how to go about these kinds of tasks. What I am trying to achieve is a layout with some box...

Callback, return value and HTML5 executeSql function

Hi. I have a big problem. I know it's about callback, closure but I don't know how to solve the problem. Here is my code $.Model.extend('Article', { findAll : function(params, success, error){ var result = [] db.transaction(function(tx) { tx.executeSql('select * fr...

does the callback passed to jquery's $.get() execute in a separate thread?

Hi everyone, Very simple question: suppose I have the following js/jquery code doSomething(); $.get(url, callback); doSomethingElse(); I understand that right after the GET request is sent doSomethingElse() starts being executed. Now suppose that the server's reply arrives while doSomethingElse() is executing. What happens? Does ...

jQuery Inserting a Button After An Anchor

How in jQuery would I add a button directly after an anchor tag? For example, my HTML looks like: <div style="border-style: solid; border-width: thin; padding: 2px;"> <center> <a target="_blank" href="http://www.mydomain.com/"&gt;MyDomain.com&lt;/a&gt; <b>My Hypertext Link</b> <br/> Options: <a class="theAClass" hr...

Chrome extension using ibox popup

I am trying to make a popup appear using the iBox javascript. When I tested on my machine using a simple html (called "test.html"), it worked fine. However, when I used the same call in my Chrome extension document.addEventListener('keydown', function(e){ if (e.keyCode == 81 && e.altKey && !e.shiftKey && e.ctrlKey) { iBox.showURL('se...

Ignoring empty XML nodes in JavaScript

I'm loading in an XML file in JavaScript, and once I've done that, I'm iterating through all of the Document's childNodes, which are all of the XML elements in the document. The problem that I'm having is that I need to ignore elements which are just not real elements, but rather newlines, tabs, etc. Right now I'm doing the following: f...

How to create a template that will show only in IE6 using javascript?

Well the question is self explanatory! but the thing is I have no experience with javascript at all, but it seems to me that it's simple to do just that! oh and the changes will be only into the css side nothilg will change into the html, by the way this is a CMS template (joomla) so the index is dot-php wich should make it easy... I th...

dynamically setting properties in uploadify

is it possible to add a new property to a previously declared object? Here is some code to clarify (with the uploadify jquery plugin): $('#featuredimageupload').uploadify({ 'uploader' : base_url + 'media/js/uploadify.swf', 'script': base_url + 'post/uploadflash', 'multi' : true, 'queueID' : 'queue', ...

How do I get around access denied when trying to view the parent of an IFRAME

So I have this craptastic code that I inherited and an insane client as well. This program uses IFRAMES to emulate AJAX like calls since the previous dev could not be bothered to just do AJAX. Anyway, the problem is, is that the app calls a javascript that then sets the source of the IFRAME to some dynamic javascript. Okay, now at the...

replace in jQuery

Hi Can some one help me in this I had a variable var myValue = "what is you name? what is your age?" i want to find the '?' in the string and replace it with a html input text element where the user can enter the answer in the text box and at last i need a string as out put like this "what is your name my name is xyz what is your...

incrementing a value after each refresh in javascript

Hi friends, Please help me to do this I want to refresh my web page in every fixed time period. i have done with a javascript timer. But actually i'm not refreshing the same page, it will go to next page after each refreah. I'm developing a web application in asp.net c# for example my url will look like this http://localhost:1096/...

Rich Text Editor with Gmail style spell check

I am after a JavaScript Rich Text Editor that supports highlighting words and triggering events when those highlighted words are clicked, like what Gmail does when in spellcheck mode. I will need to heavily customize any existing solution, so something that is easy to extend would be ideal. Currently I am leaning towards TinyMCE. ...

javascript game framework

Nowadays with <canvas>, it is easy to find all kind of cool stuff around the net. Like emulators, demos, games, just visual stuff, etc. But it seems that everyone is programming using the basic primitives of canvas. There exist any framework working over <canvas> or utility library? ...

Spring Faces Javascript

Hi. I want to ask where do i put my external javascript files and how to access them in the page. I have a problem with getting the relative path for my javascript files. ...

how to insert this javascript in php

how to insert this javascript code : thejavascript <A HREF="javascript:void(0)" onclick="window.open('welcome.html','welcome')"> </A> inside img src in php <img src="http:'.$iv[$j].'.jpg" height="220" width="200" alt="Image '.ucwords($kw).'" "thejavascript"> Thanks ...

Selecting text in mobile Safari on iPhone

I'm trying to make it easy for an iphone user to copy some text to the clipboard in mobile safari. As in the usual "touch-hold-copy". There is a specific bit of text I want to a user to copy. I have full choice of the html markup in which to wrap the text. How can I make it easy, rather than abitrary? For instance: Is there a way to "s...

Call javascript method on dynamic form element

I am creating new textbox using javscript. I want to call a javascript method onkeyup event of this newly created textbox. How will I do this ? Below is my code var element2 = document.createElement("input"); element2.type = "text"; element2.id='complete-field'+tableID; element2.name=tableID; ...

Jquery Count Divs with class name

Seems pretty simple but I cant get it to work. If I have two divs with the class of 'user' I want to output 'you have 2 divs' <script type="text/javascript"> $(document).ready(function() { function divcount() { var mycount = $('.user').length(); document.write(mycount) } }); </script> I'm sure im mi...

An other way to load a js file in js code

I opened a javaScript file in a javaScript time.... document.write("<script src='newnote.js' type='text/javascript'></script>"); is there an other way to load the js in js code..? (this file is for loading a popup menu js code , which is loaded after delay by clock js code ... so i want an othe way to loaded it) ...