javascript

Javascript SQL database

Hi all. I'm wanting to deliver some data from the server-side to some client-side Javascript which can use said data to construct a database/table, and then query it using some user-input SQL. Persistence of data isn't what I'm looking for, so HTML5 stuff like localStorage isn't relevant, I'm only wanting to be able to create something...

Help me implementing addClassName in my JavaScript project the right way

Hi, I find myself often needing addClassName and removeClassName functions for Elements. However, I dare not to extend the native Element due to potential collisions. So, now I am wondering what to do. I took a look at ExtJS, and it achieves this like: var element = document.getElementById('...'); var elem = new Ext.Element(element); ...

executing a reference to field.onchange in Firefox

I have HTML code which calls a javascript function from a form, using: <form name="f" id="f" ...> <input name="myField" onchange="doFunct(f.myField.value,f.yourField);" /> <input name="yourfield" onchange="doFunct(f.yourField.value,f.anotherField);" /> ... In the javascript code: function doFunct(field,dest){ // do something ...

return js value in HTML

Hi All, First tentative steps into client side. I'm having trouble finishing the following. My question is how do I return the value of a function in a HTML statement ... <script language="Javascript"> function checkjava() { return 1 } </script> </head> <body> <form action="enabled_catch.php" method="get" name="your_form"> <input typ...

jQuery: Fire click on event on a span

I saw a post earlier today and have been playing around with: http://arashkarimzadeh.com/index.php/jquery/7-editable-jquery-plugin.html What I'd like to be able to do is when a span gets clicked, to fire the click event on a different element in the page: <div class='editable sampleItem pointer' id='qqq'>click me!!!</div> Is that pos...

Problem with input type='file'

I am working on getting my website to display nicely in IE7. IE6 is already done, and also FF, Chrome, Safari, Opera etc... I am running IE7 in IETester if that makes any difference. I have a problem with an input type='file' in IE7. The button next to it (browse button) is very short with hardly any width at all. It is as if the butto...

Set Session variable using javascript in PHP

HI , can we set session variable using javascript in php? ...

How can I add an AddToFavorites link to a details page in ASP.NET MVC?

I have a details view with a sidebar and I would like to allow the user to add the current details to their favorites. I'm current using the following javascript, but I don't know how to pass the details id to the javascript to generate the link to be added to the users favorites. My javascript - This doesn't work of course... <script ...

"Warning: page has expired" error in IE when hitting "back" button

I have a classifieds website, and when posting a new classified users fill out a form offcourse. Then they hit the submit button, and a "verify" page appears which displays what they have filled out, and if it looks good, the users hit the "ok" button and the classified is posted. Here is a short example: <form action="verify.php" na...

How to doc a variable number of parameters

Hi, How do I doc a variable number of parameters? I am writing an application in PHP and JavaScript. Currently I have (in JavaScript): /** * Description * @param {String} description */ function fn() { // arguments holds all strings. } So, how do I doc n-number of string params? ...

Good links/books about JavaScript event handlers

I have been playing around JavaScript for a year or so, one thing I learned is that event handling has to be done very carefully so now I would like to learn JavaScript event handling very seriously. One of the reason to be so serious is that I would like to try hands on some small game in JavaScript using Canvas and I would like to po...

IE browser back button problem

I have a page with a search form, and when submitted, the form action is set to an iframe on the same page. The iframe displays the search-results. THEN, when clicking on a result, a new page opens displaying it. However, when hitting back from the displayed page, the iframe is closed, and it is as if no search was made at all. Is this...

get safari to not show broken image symbol

is there a way to get safari not to show the "broken image" symbol, when an image was not found? firefox does this by default. i'd preferrably do this with css, but i think javascript will be the way to go... i am using jquery already, eg something like this would be great: $(document).ready(function(){ $('img').broken().hide(); })...

How can I perform mathematical operation like cos and sin in Javascript or jQuery?

I have a searchlocationNear function for which i pass geocoded data i need to calculate distance based on lattitude and longitude values but during the alert functions of distance it displays undefined is their any problem with my code. function searchLocationsNear(center) { var radius = document.getElementById('radiusSelect').valu...

Parsing JavaScript argument values in python

Is there a way to parse the argument values passed to a JavaScript function in python? I want to be able to automatically document JavaScript function calls in order to make sure they have the right arguments passed to them. For example, in: function mymethod(fruit, vegetable, drink) { // dummy function } function drink(drink) ...

Blank Ul not containing li shows padding and margin in IE

I have dynamically generated dropdown menu. On mouse hover It shows blank space if one tab do not have dropdown options. ...

Accessing this from within an object's inline function

I'm having difficulty referencing "this" from within a javascript inline function, within an object method. var testObject = { oThis : this, testVariable : "somestring", init : function(){ console.log(this.testVariable); // outputs testVariable as expected this.testObject.submit(function(){ var a...

How to access and set iFrame element?

Currently, I am using jquery to make a certain class/span editable: $(function(){$('.test').editable({editClass:'tryThis',type:'textarea'})}); That works great. Now, what I would like to do is put the source into an iFrame (ID=iTarget). How would I access this class now? I tried: $(function(){document.getElementById('iTarget').$('...

Error: 'jQuery is not defined'

Hi, I have written a script with jQuery. It works with Firefox and GoogleChrome. Only with IE I have this error returned: 'jQuery' is not defined jquery-ui-1.8.4.custom.min.js, Row 10 Character 1 This is the head of my page: <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Contattaci...

Using Javascript to load other external Javascripts.

Dear experts, I have a library of JS code to load from a folder. Instead of typing the lines one by one in the tag of the HTML document, is there a way of just link one Javascript file which organizes and automatically load other javascript files. I know the Dojotoolkit is using this technique where only one JS file is loaded onto th...