javascript

Why the value inside the loop and using the [i] is undefined ?

using Mozilla jetpack , when i do the following code .. i get that linking is undefined !!! why ? or how to fix it ? var links = doc.querySelectorAll('#courses_menu > ul > li > a'); var linkz=links[1].href.split("?"); var i = 0; for (i=0;i<=4;i++) { var linking= links[i]; } jetpack.notifications.show(" "+ linking); ...

using popupNode in a javascript firefox extension

Hello, I am trying to use popupNode in a little javascript based firefox extension. So if a user right click on a link and then clicks on an additional menu item a new tab opens with the link (sorta like "open in new tab"): ` var foo = { onLoad: function() { // initialization code this.initialized = true; }, onMenuItemComm...

JW Player - Video works in chrome, not firefox or IE

See working link. On the homepage I have two videos (#intro_video & #video_container) which under chrome I have no problems, but in firefox and IE the video doesn't play. It's loading the preview image but when you click play it tries to load for a moment and then goes back to the preview. I have tried using Jquery Flash (loads #intro...

Parse Credit Card input from Magnetic Stripe

Does anyone know how to parse a credit card string input from a Magnetic Card Swiper? I tried a JavaScript parser but never got it to work. This is what the input looks like. %BNNNNNNNNNNNNNNNN^DOE/JOHN ^1210201901000101000100061000000?;NNNNNNNNNNNNNNNN=12102019010106111001? The N's are the credit card number. ...

in jQuery, how to remove an element that has only one whitespace?

Given the following HTML on a page: <div class='test'> <p><span id='id1' class='test1 test2 test3'>test text 1</span></p> <p><span id='id2' class='test1 test2'>test text 2</span></p> <span class='test2'> </span> <p><span id='id3' class='test1'>test text 3</span></p> <p><span id='id4' class='test1 test3 test2'>text4</span></p> </div> H...

javascript to find tinymce rich text editor value is null or not

Hai guys, I use TinyMce textarea in one of my web application... How to check tinymce textarea's value is null or not using javascript? document.getElementById("myeditorid").value didnt help me.... ...

Mousemove showing unexpected grey rect on mac + firefox?

Hi, I'm trying to use SVG. I put this into an xhtml file: <?xml version="1.0"?> <!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN""http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml"&gt; <body> <svg:svg xmlns:svg="http://www.w3.org/2000/...

How to get info from another website from my HTML page ?

What is needed is as follows: I have an HTML webpage and I need to access another website and get something from its source code. I want to run something like link = "http://www.google.com"; doc.querySelectorAll('#courses_menu > ul > li > a'); // Apply on the link. to get what I need from the link and use it! However, I am using J...

How to distinguish browser back / forward button?

Is it possible? even better, is it possible with jQuery? I need to know whether use click back button or forward button so I can use page transition effect correctly, eg. slide from left - right if they hit forward and vice versa. ...

javascript syntax problem

I have this in the head of my document: <script type="text/javascript"> var myString= location.href; var mySplit = myString.split("#"); var x = mySplit[1]; if (x == 'page1_div1') { document.getElementById('div1').className = 'theNewClass'; } </script> What i...

slide show with css and javascript

hi every one just i want to make imsge slide show with help of css,javascript or jquery like http://www.webguide.nl/internetbureaus/mediaweb-internet-integrators/deltalloyd-regatta.3878.lynkx?pageStart=1. this is in flash but i want it the image come dynamically from database in php. can any one help me please . ...

XMPP C# Interaction

I am trying to connect via c# and via javascript to an xmpp server (currently ejabberd). Im having a little trouble conceptualizing how the connections will exists. Backstory: I have a game engine that will take input from the user and send some kind of response back to them. The user may be a windows app, a web app, all needing to con...

How to make a onmouseover work in mysql catalog

Hi everyone! I'm having difficulty creating a button on my catalog page, the catalog page returns either 8 15 or 20 products from a mysql database so i use a loop to pull each product out of the database, and i need a addtocart button which uses javascript to create an onmouseover effect the code is as follows echo "<a href=\"catalog...

How to remove the handler in javascript

I'm adding some document to addhandler, where this script will execute on each time on ajax call. But on the ajax result how can I remove the handler, where i tried using removeHandler but for the first time its getting affected. Is any method to check whether the event is alive kill it. ...

Very newbee question on How to think of Javascript-is this accurate?

This may seem a strange question, but please bare with me. I'm working through some javascript examples, and I just did this one: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head> <meta http-equiv="Content-Type" content=...

Assigning the result of a JavaScript confirm box to a PHP variable

//this is in php function msgbox($msg, $type) { if ($type == "alert") { // Simple alert window ?> <script language="JavaScript"> alert("<? echo $msg; ?>"); </script> <? } elseif ($type == "confirm") { // Enter Confirm Code Here and assign the $result variable for use // ...

Is there any way to make a date object in 12 hour mode in javascript

Hii, I have to make date time in 12hr mode i.e. 23 January 2010 1:30 PM in java script ...

assigning the result of a jsp confirm box to a php variable

//this is in php. function msgbox($msg, $type) { if ($type == "alert") { // Simple alert window ?> <script language="JavaScript"> alert("<? echo $msg; ?>"); </script> <? } elseif ($type == "confirm") { // Enter Confirm Code Here and assign the $result variable for use //...

Call a function if a variable contains any items in an array?

How can i call a javascript function if a string contains any of the items in an array()? Yes, i can use jquery :) ...

How do I select all text contained in <pre> using jQuery?

Hi, I have a contentEditable iframe with line numbers and text. The line numbers are contained in a div and all text is in a <pre>-element. It looks like this: <body> <div id="line_numbers"> <div>1</div><div>2</div><div>3</div> </div> <pre> Text </pre> </body> Now, when someone presses Ctrl+A everything is selecte...