SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Feb 2004
    Location
    UK
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Moving from jQuery 1.2.6 to jQuery 1.9.0 causing errors

    Hi when run jQuery 1.9.0 on my site rather than 1.2.6 I get an error caused by the blur on a form, if I remove the code below I get no errors but the blur on the form is obviously gone, any idea what is causing the problem?

    Code:
    $(function() {
    	http_val = '';
    	if ($('input#http').length > 0)
    		http_val = $('input#http').attr('value');
    
    	$('#quick_search input[@type=text]').focus(function() {
    		if ($(this).attr('value') == $(this).attr('title'))
    			$(this).attr('value', '');
    	});
    
    	$('#quick_search input[@type=text]').blur(function() {
    		if ($(this).attr('value') == '')
    			$(this).attr('value', $(this).attr('title'));
    	});
    
    	if ($('#frm').length > 0)
    		$('#frm_search').remove();
    Thanks John

  2. #2
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,311
    Mentioned
    177 Post(s)
    Tagged
    8 Thread(s)
    Hi there,

    Something in that code will have been deprecated.
    I don't have an idea off the top of my head, but if you could post a link to your site, it should be relatively simple to figure out.

    Edit:

    Try $("#quick_search input[type='text']") instead of $('#quick_search input[@type=text]')
    Does that make a difference?

  3. #3
    SitePoint Member
    Join Date
    Feb 2004
    Location
    UK
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Pullo View Post
    Hi there,

    Something in that code will have been deprecated.
    I don't have an idea off the top of my head, but if you could post a link to your site, it should be relatively simple to figure out.

    Edit:

    Try $("#quick_search input[type='text']") instead of $('#quick_search input[@type=text]')
    Does that make a difference?
    That worked perfectly, thanks for your time

  4. #4
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,311
    Mentioned
    177 Post(s)
    Tagged
    8 Thread(s)
    No problems
    Thank you for taking the time to follow up.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •