jquery

How do i enclose the Single quotes in double quotes in javascript

I have a php variable that needs to be interpreted in javascript how do i do this var cntr = "<?php echo $j;?>"; var opt = "<?php echo $options;?>"; var opt_selected = "<?php echo get_options($val['SOMEVARIABLE'],$opt); ?>"; var reference = "<?php echo $val["RFDREFVAL"];?>"; How do i correct the above statements iam getting Javascrip...

DOM manipulation: Replacing href value with src value of child image

Hi I have the following html markup: <div class='photoset'> <a href="foo-01.html"><img src="foo-01.jpg" /></a> <a href="foo-02.html"><img src="foo-02.jpg" /></a> <a href="foo-03.html"><img src="foo-03.jpg" /></a> <a href="foo-04.html"><img src="foo-04.jpg" /></a> </div> I want to manuipulate the DOM so that the src value o...

stripped down version of jQuery for ajax/json funtionality

I like Ajax/Json features of jquery but the library is very big for blackberry phone development. Has anyone pulled out or developed a stand alone Ajax/Json library similar to jquery's? I know that a mobile version of jquery is coming, but this looks like it is more directed at GUI for iphone. I also tried XUI, but have been getting ja...

document.width - IE Bug

I am trying to set the width and height of a mask behind a modal window. I am using $(document).width() and $(document).height(). Works great in FF and Chrome but IE adds about 25px to each and I end up with scroll bars? What am I supposed to use that is cross browser compatible? I am using IE8 btw, but I want it to work down to 6 or...

JQuery Datepicker in Zend Framework not showing correctly

Hi, I have the following problem: I made a form, wich extends from Zend_Form, where I added a ZendX_JQuery_Form_Element_Datepicker like you can see in this picture: http://i.imgur.com/uGFpH.png But when I view that page in the browser, the datepicker seems to work, but the layout is messed up. See this picture: i.imgur.com/MuFSQ.png ...

How to get value of select element and how to act on change?

Having a problem with the change() event in jQuery: $("select[name=cmm]").change(function(){ total(); }); For some reason the "total" function isn't being called with the code above. The html code is: <select name="cmm"> <option value="none">none</option> <option value="one">the first</option> <option value="t...

Jquery animate. Display none css is not changing.

Hello to all, I am trying to do is, in the first load of the page the image have to display:none. But the problem is, when I put display none, the animate function is not working and I already put a .css({'display':'block'}) still not working. Here is my code <script type="text/javascript"> $(document).ready(function() { $...

who to fill detail input base on child window popup

I have a parent window for entry transaction that havs customer ID field input. User have to click find button beside it and new window will be opened and user can findout there. Whenever user choose selected customer, the parent will display some information of the customer like name, address may be, and detail of claim. Anybody can sho...

ASP.NET MVC2 and JSON model binding with validation to an action method

Phil Haack's blog entry describes this process using ASP.NET MVC 2's futures and Crockford's json2.js. John Resig also recommends using Crockford's json2.js in this article regarding "use strict";. To get this feature today, would you still download the MVC 2 Futures, or is this included in the MVC 2 final, or is this part of the new M...

IE not observing offset position

Hi All, I have just noticed my new script has a problem in ie 7 and 8 re: offset and position. Everything works fine in modern browsers, but i can not account for the reason IE refuses to adhere to the offset position i specify..? The Jquery: $(document).ready(function() { $("#%id%").css("margin" , 0); var position = $("#%id%").offse...

Change button text jquery mobile

I'm using the new jquery mobile 1.0 alpha 1 release to build a mobile app and I need to be able to toggle the text of a button. Toggling the text works fine, but as soon as you perform the text replacement the css formatting gets broken. Screenshot of the messed up formatting: http://awesomescreenshot.com/03e2r50d2 <div class="ui-...

Manipulate HTML with jQuery

I'm trying to style some HTML, generated from Google Calendar, it's something I don't have control off. It's plain simple HTML. This is what I have: <li><a><span class="data">When: gio 27 gen 2011<br /><br />Where: XXXX<br />Event state: confirmed</span></a></li> <li><a><span class="data">When: gio 20 gen 2011<br /><br />Where: XXX...

How do i append or prepend this dynamic rows in to the table using jquery

$j=1; ?> var t =''; var options = ""; </script> <?php foreach ($this->data['DEFAULTS'] as $rec){ foreach ($rec as $key=>$val){ ?> <script type="text/javascript"> var cntr = "<?php echo $j;?>"; var reference_v...

Show as an alert instead

I have these lines in a script which I'd like to show as an alert instead: mce_jQuery('#mce-'+resp.result+'-response').show(); mce_jQuery('#mce-'+resp.result+'-response').html(msg); but the alert displays it as-is, what do I need to change? ...

javascript location.href onchange event listener?

I want to show a message whenever you are leaving the page (not an annoying alert, just some html telling you to wait), in thinking about it I'm facing certain difficulties: when the user presses Stop in the browser, cancelling the navigate-away action, I'd like the message to go away. whenever any link is clicked, the message should a...

How would I modify my jQuery ajax response to do the same thing with JSON that it currently does by returning JavaScript?

$('.showprayer').click( function(event) { $.post('/show_prayer', { 'name' : $(this).text() }, function(data) { eval(data); }); }); The jQuery function above returns the following string as the ajax response coming back from the server: '#prayer_date'.html("03/19/1968"); Someone seeing this code earlier responded that "...

How can I pass more than one array using $.ajax to ASP.NET MVC action?

I'd like to pass the contents of two sets of textboxes to an action on my controller using jQuery $.ajax. Code I have so far is as follows (all abbreviated for ease of reading): In my html: <div class="venue-holder"> <input class="tb-venue" id="venue" name="venue" readonly="readonly" type="text" value="Esfahan" /> <input class=...

find and display element from the ajax file

Consider this ajax call: $.ajax({ type: "POST", url: "misc/moreactivities.php", data: { lastmsg : ID, pid: pid }, cache: false, success: function(html){ $("#profileWall").append(html); $("#more"+ID).remove(); } }); Right now it appends everything that is output in moreactivities.php. I only wa...

ajax: how to reopen a div after closing using ajax

Hello all; I call a page with ajax in a div. when the page opens, there is a "close "button to hide the div. After clicking the close button, I need to refresh the page to reopen the div. What should I do to open and close the div as much as I like without refreshing the page? code: <script> $(document).ready(function(){ $('#close...

What is !! in javascript ?

Possible Duplicate: What does the !! operator (double exclamation point) mean in JavaScript? $("#imjavascript").attr('checked', !!$('#mainCheck').attr('checked')); what do !! mean ? ...