javascript

Update flashvars and reload flash with jQuery

I would like to update the flashvars value argument to view another video: <param name='flashvars' value='movieId=1002' /> I found out that I can make it work in Firefox by updating the parameter with the extra step of readding the whole flash contents. $("param[name=flashvars]").attr("value", "movieId=33"); $("embed").attr("flashvar...

Select drop down html

I have a main select "main", and a list from 2 till 9, depending the situation, of more selects. What if I want to change the value in all this secondary selects, with the same value that the main select?. So the main select will change more than 1 select at the same time: So, I have got the main select: <select name="main" id="main" on...

jQuery to change global css property from within an iframe

I have using colobox which is a jquery modal window to create a login/regiestration process through modal pages called in an iframe. I am hoping to be able to switch the css from a link within the iframe. I am trying to change the height of the modal window when switching between ajax pages within the iframe. If I try something like ...

How do I add an element to an existing property map in JavaScript?

I'm using this piece of code to create a property map that I will pass to jQuery: var myMap = {"one": 1, "two": 2, "three": 3}; However, this isn't complete. I want to iterate through a for loop and create a complex property map, that looks like this: [... { sleep: 2, fade: 1 }, [ { src: 'sand-castle.jpeg' }, { src: 'sunflowe...

How can you replace these onclick="..." attributes with cleaner jQuery style code?

I have some code a little like this... <img src="..." width="100" height="100" alt="" onclick="FlipImg(1234)" /> There are lots of these images on the page, each with a different id in the FlipImg() call. I normally prefer to put this type of code into a bit of jQuery, maybe a little like this... $("img").click(FlipImg(<id from some...

Opera onkeyup broken? Repeats, fires while down

When I add any onkeyup event, it does not do what it's supposed to in Opera. It fires repeatedly while the key is held, not when it's released. This same event works correctly in Chrome and Firefox. I have no listeners for keydown or keypressed. This simple code logs a stream of key events to the console in Opera when the key is held do...

copy/Clone dropdown list with selected option in jquery

How can I clone dropdown list(combobox) with selected option? jquery .clone method is not working in firefox for selected option. I have a div having different controls. I have to copy entire div to a variable something like this var $orginalDiv = $('#myDiv'); var $clonedDiv = $orginalDiv.clone(); $clonedDiv.find('select').each(fun...

Jquery change method and bulk class adding

Hello I have a table (with class name ".data") with it's thead holding a single checkbox for selecting / deselecting all checkboxes inside my tbody. Also each checkbox inside the tbody can be selected invidually and once a checkbox is selected, it adds a new class to the selected row(for making background some other color for highlighti...

Google map Geolocation formatting address

I'm using Geo location service with Gmap Api and i would like to know ,how do i have to format data address ? i have to format addresses according to local server location. which is the best practice? ...

Why is Javascript the "most misunderstood language" ?

Douglas Crockford himself says so ! http://www.crockford.com/javascript/javascript.html I have been working with JS only for the past few months, with jQuery and ExtJS. Soon will get to work on Secha Touch. I find Javascript to be highly enlightening.. What is your opinion ? Crockford himself says that the language is not without its...

Can this sort be made more elegant/recursive

I have a table which needs to be sorted by several columns - let's say music which is sorted by genre, then by artist, album and so on. Or you can sort by artist/album/track. This is what I came up with in jquery: function tableSort (by) { var mylist = $('#...

How to omit data in some cells, where table is filled from xml file

I have xml file with data that i have to display in table. Now I am displaying all data row by row, so my table looks like: User | Date | Something John | 05.10| task_1 John | 05.10| task_2 John | 16.10| task_3 Jane | 16.10| task_1 but i want to get something like: User | Date | Something John | 05.10| task_1 | ...

how to work on same search tab on multiple html pages

I have around ten html pages all have search tab ,only one page is dedicated to display the search result , from which ever page i enter search it directs to search page and displays output ,is their any better method to do this? I am using jquery on clientside and webservices written in c# on the server side and i am not using master p...

regExpression.test

<script language="javascript"> alert("......"); var regExpression = /^([a-zA-Z0-9_\-\.]+)$/; //line 2 //// var regExpression = "/" + "^([a-zA-Z0-9_\-\.]+)$" + "/"; //line 3 alert (regExpression.test("11aa")); alert("......2"); </script> The above code is working fine. But if we replace line 2 by line 3 then it is not working why? i...

DatePicker Problem

Hi, I have to set the startdate/Mindate in jquery datapicked calender. i am using datepicker v1.7.2. and using mindate and max date prpperty but its not working fine. ...

JQUERY getJSON / ajax response not being processed

I am sending a json request to a server as below: $.getJSON("prod_search.php?type=getCustInfo&custID="+custID, function(json) { alert(json.address); $("#invAddress").html(json.address); $("#currency").html(json.second); }); Using firebug to check, the response is below, but the alert shows 'undefined' and no values are inserted....

Call javascript on checkbox onclick

Hi, I don't understand what I'm doing wrong here. I just want my function to be called when I click the checkbox. Replacing the function call with alert() works, am I referencing my function incorrectly? <html> <head></head> <body> <script type="text/javascript"> function select(a){ document.getElementById("myDiv").innerHTML=""+a; ...

Scope problem in JS: Uncaught TypeError: Object #<an Object> has no method 'createDocumentFragment'

I'm trying to make instrument to simplify work with complex grids of jqGrid, a function that could read schemes of grids, but looks like i lack JS skills for that ) function renderGridSystemRecursively(scheme, container){ // CHILDREN if ('children' in scheme && scheme.children.length > 0) { scheme.prm.gridPrm.subGrid = true...

calendar widget in javascript

What is the best way to create a calendar with JavaScript like the jquery Datepicker where I can add some more functionality? I want to display some arrays of dates in different colors in it as well as selecting a date. Shall I try to edit the source code, or better, use some library and do it myself? For the first case I would like t...

using PHP in external JS

Hello, I have a big validation JS script. I want to put this script to be external JS. Everything works fine with this, but in the JS i use cookie to handle the my user form junctions. And besides, i use PHP in this JS. If the JS in the html, then works. But if i put it to external, then no. For example: External JS: $(document)....