javascript

Undefined return value

what's wrong to my code..where my return value found undefind... var so; var imgid_callback1; const DIV_ID = 'locationsample'; function setup() { try { so = device.getServiceObject("Service.Location", "ILocation"); } catch (e) { alert('<setup> ' + e); } } function getLocation(imgId) { var updateopt...

PHP Beginner: How to pass PHP variable from one PHP code segment to another ?

I have index.php which uploads a file to server and sets several PHP variables (like $target_folder_and_file_name). index.php also has the following line (it was originally index.html): <script language="JavaScript" src="main.js.php"></script> After index.php returned to the browser, the browsers asks for main.js.php from the server ...

document.write buggy?

Something wrong with the code? I could print Hello on HTML but when I add to getPlayerVersion, the whole string doesn't print. What could be problem be? Leaving me feeling frustrated. <script type="text/javascript"> document.write("Hello"+deconcept.SWFObjectUtil.getPlayerVersion().major); </script> ...

unable to document.write on this code

Which code do I need to fix? Thank! document.write(' var parameters = { id: "1" , src: "<?php echo $source?>" , autoPlay: "false" , width: "638" , height: "400" , autoHideControlBar: "false" , control...

Show a picture when mousemove over a text with jquery?

Hello, do you know any tutorial or script that shows a picture when mousemove over a html text? ...

Trouble with Canvas rendering in Safari/Opera

Been banging my head against this one for a while, and figured I'd turn to the experts for some advice. I've made a jQuery snippet that grabs the values from a table and plots them in a line graph on a canvas element (also generated by the JS). All's well in Firefox and Chrome, but Safari and Opera aren't displaying the plotted points. ...

jQTouch on Iphone - jumping to specific DIV after onclick and javascript function

I am just starting to use jQTouch. In #contact I have a button that calls javascript function sendEmail() How can I jump to/show the div #statusDiv in the javascript function after sending the email? function sendEmail() { // sending email // --> how to jump to DIV called statusDiv } <div id="home" class="cur...

Adding AJAX call to function triggered popup blocker

Hi folks, I have a client who wants to open variously sized images in a centered popup. I tried to get them to use FancyBox but they don't want interstitial presentation, so... I initially was opening a generic popup which resized and centered onload based on image size but they don't like the shift so I added a PHP script to echo the...

Javascript / Flash : When exactly are flash external callback methods triggered ?

I have a flash application using callbacks to javascript functions (eg. when it receives some data over a socket, it'll call a js script which would change the content of a div according to that given data). Afaik, there is no actual mutual exclusion in javascript so I'm not sure if I can/need to simulate something like : callbackFunc...

How to I correctly add brackets to this code

This code trims whitespace, (fyi: it's credited to be very fast) function wSpaceTrim(s){ var start = -1, end = s.length; while (s.charCodeAt(--end) < 33 ); //here while (s.charCodeAt(++start) < 33 ); //here also return s.slice( start, end + 1 ); } The while loops don't have brackets, how would i correctly add br...

reinitializing javascript object's properties

In my Javascript drag and drop build app, a variety of buildings can be built. The specific characteristics of these are all saved in one object, like var buildings = { house: ['#07DA21',12,12,0,20], bank: ['#E7DFF2',16,16,0,3], stadium: ['#000000',12,12,0,1], townhall: ['#2082A8',20,8,0,1], etcetera } So every building has a number o...

Is canvas security model ignoring access-control-allow-origin headers?

It seems that even if you set the access-control-allow-origin header to allow access from mydomain.org to an image hosted on domain example.org, the canvas' origin-clean flag gets set to false, and trying to manipulate that image's pixel data will trigger a security exception. Shouldn't canvas' obey the access-control-allow-origin heade...

onclick event from XML Nodes

My Documents are a mixture of XML and HTML Tags. where HTML tags are pulled from xhtml namespace and mine are from various namspaces. I wanna take user interaction events from XML Nodes of my Document. I First tried <do:landingTime xhtml:onclick="fnc">20:48:29.45</do:landingTime> with no Luck. But <xhtml:span onclick="fnc"> works. So is ...

Calling a groovy script or Java from Javascript

Hey! I have a cool bit of dojo running where I click a button - and it brings a success message on the screen via javascript. Is it possible to issue a call to a server side Groovy script foo.groovy from within this Javascript - because not only do I want to show the cool success message - but I need to do some work in the background at...

Javascript: Make Rows Draggable Through Input Field Handles

I have created a table with draggable rows. Unfortunately, most of the rows are covered with a large textbox input element. In order to drag the rows, you have to grab the row on the very edge just outside of the textbox. Is there a way to allow the rows to be grabbed through the textboxes without destroying the textbox functionality?...

Using Javascript to submit forms.

EDIT: For some reason if I change the input into an , the submit code works fine. Ok, this works, I'll just style the a tag to look like an input tag in css. I am using a jQuery function to submit a form when a certain button is pressed, however this seems to have no effect on the form. My code is as follows: HTML: <form id="loginForm...

Dynamically change embedded video src in IE/Chrome (works in Firefox)

I'm trying to dynamically change an embedded video on a page. It's working in Firefox but for some reason it's not working in IE and Chrome (strange combination). Here's the HTML: <object id="viewer" width="575" height="344"> <param name="wmode" value="transparent" /> <param name="movie" value="http://www.youtube.com/...

Use AJAX to load webpage content into DIV

Hello. I have a text field. When I type something into than text field, I want to load stuff into the DIV below. That's my code equivalent: <input type="text" onkeyup="/* I am not sure how it's done, but I'll just write: */ document.getElementById('search_results').innerHTML = getContents('search.php?query='+this.value);" /><br/> <div ...

jQuery Actual image diamension

I have a 1024x768 image <span class="frame"> <img alt="Image" title="Image" src="hD41120CA-7164-11DF-A79E-F4CE462E9D80_Green_Sea_Turtle.jpg"> </span> and the below CSS sets the image width to .frame img{ width:425px; } And the jQuery code $('.uploaded_image img').attr("width"); returns 425 How can i retrieve the actual ...

clickevent in javascript

what is difference between onclick and onclientclick events? ...