javascript

Livevalidation and group of checkbox, radio, select

Hi, Livevalidation script is great to validate forms but how you 're suppose to do with group of checkbox, radio, and select. see website : http://www.livevalidation.com/ Thanks. ...

How to assign value to id?

I have one string name as id in my .aspx.cs page and one javaScript function SetValue(val) on .aspx page in which I have to assign val to that id. How will I do this in java script fuction SetVal(val)? ...

TinyMCE: Double forecolor and backcolor buttons?

I'm having a problem using TinyMCE. In IE8, the forecolor and backcolor, for some random reason, is displayed twice. See picture below. Source code (I add the forecolor and backcolor in theme_advanced_buttons2): tinyMCE.init({ mode : "exact", elements : "<%= editArea.ClientID %>", custom_shortcuts : false, language : "en", relative...

preventDefault won't work on Firefox

I'm trying to prevent A HREF from actually opening the link, but to execute a script. I got the script part working, but it seems Firefox would just ignore this: $("#permalink a").click(function(id){ $("#newPost").fadeToggle; event.preventDefault(); var id = this.getAttribute('href'); $("#newPostContent").load(id); $("#newPost...

How do I retrieve values from dojo.data.ItemFileReadStore

First, I read this short help thread here: CLICK It uses a JSON file built together with PHP which looks something like THIS: { name:'Italy', type:'country' }, { name:'North America', type:'continent', children:[{_reference:'Mexico'}, {_reference:'Canada'}, {_reference:'United States of America'}] }, { name:'Mexico', type:'count...

Get URL of selected element

Hi, I'm just getting started with jQuery and I want to get the url of a selected element so I can do something with it. To start with I'm just trying to get the url of a hovered link to show up in an alert. Can anyone tell me where I'm going wrong? $(function() { $("table#content > tbody > tr > td > a[href*=delete]").hover(funct...

How can I check my object type is Image ?

If I write something like this: var img = $(new Image()).attr('src', image.src); How can I check later if img var is an image and not something else ? ...

jQuery Modal not showing <script> tags with AJAX page request

I use a plug-in called nyroModal to call a page via AJAX and display it in a modal window. When the AJAX gets the page, it creates a div on the current page, when nyroModal then styles and creates the modal page for you. Problem is, it seems to strip off all the tags out of the requested page. Using firebug I can see the tags in the re...

Hiding a table row without resizing columns or breaking layout

I want to fold a table so that some rows are hidden. I want to maintain the size of columns, so that they don't leap around when you hide rows (this happens if you use display: none; indeed, the table width can also change). I also want the table to reflow when the window size is changed, so that a table full of data uses as much space...

javascript page source code

Is there a way to acces the page HTML source code using javascript? I know that i can use the document.body.innerHTML but it contains only the code inside the body. I want to get all the page source code including head and body tags with their content, and, if it's possible, also the html tag and the doctype. Is it possible? ...

Sorting items in Select with remember what is selected.

I wanted to sorting items in select, but all solution what I finded have selecting last item in select. And it's problem if you edit existing data in forms. How solve this? Please don't ask me, why I didn't sorting items at server side. ...

Performance hit if I use many YUI DataTable controls in a page

I am planning to use YUI DataTables (for look-up) extensively in my web application. I may give option to open approximately 15 DataTables in a page. I am taking care of caching the content. I would like to know if there would any performance hit on the application. Any inputs are appreciated. ...

jQuery, escape characters when selecting by href

Hi, I'm trying to select an element based on its href within a table of records. I have two links for each record: 'reorder=+' and 'reorder=-' If I use a[href*=reorder] both elements are recognised successfully, however if I try to differentiate between the two, nothing happens eg: a[href*=reorder\=\+] Is there a way around th...

how to Read Javascript cookie with PHP

Hi I'm making a php script that would work like API on site that dosn't provide one. I'm using curl for it and the site is posting cookies with javascritpt, so i can't read them. Is there a php class or php module that would read javascript, store the cookie and let me resubmit it with curl to the mentioned page? I Red somehwer that i...

java script timer problem

i have the following code in timer.php . If i run the file timer.php i get proper output as follows time left : 02 min 30 sec and this keeps on decreasing. But if include the file timper.php in other files using <? require 'timer.php' ?> only time left : is shown and actual timer countdown is not shown (in Fire fox). But if i run same...

get one value two times with jquery

I have this code in jquery : $("#order_btn").click(function(){ var totalprice = $(".price_amount").text(); $("#totalprice").val(totalprice); }); When I submit this form with a hidden value i will get the totalprice value two times, if its 200000 i will get 200000200000. why ? <input type="hidden" value="" name...

How to get Javascript function's source code from specific site using firebug?

With firebug I found that clicking on the link calls javascript function <a href="#" onclick="viewHide(this);return false;"> But I couldn't find it's implementation in page source. Is it possible to get it? The site is in hebrew, but I don't think it's problem :link text to trigger for this function click on any comments title that f...

JavaScript Code Signing

How can a user, using one of the major modern browsers, know for sure that he is running my unmodified javascript code even over an untrusted network? Here is some more info about my situation: I have a web application that deals with private information. The login process is an implementation of a password-authenticated key agreemen...

Performance difference between jQuery's .live('click', fn) and .click(fn)

I love the new live event in jQuery 1.3. The question I have is the performance of this event. I know the advantages of using live over click/bind('click') but is there a performance hit for using it over click/bind('click')? If not, why would you ever use click or bind('click')? ...

Using jQuery or just plain Javascript is it possible to change to a custom cursor?

I know it is possible to use jQuery to do something like: $('body').css('cursor','wait'); What I want to know is: is it possible to change the cursor to a custom loading animation, such as a simple 'spinner' gif? Many thanks in advance. ...