SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Wizard silver trophy TheOriginalH's Avatar
    Join Date
    Aug 2000
    Location
    Thailand
    Posts
    4,810
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    jQuery syntax problem

    I am so close to solving something that it's making me tingle, but my syntax isn't right. I'm trying the following:

    Code:
        $(this).attr("href").append("&js");
        $("#loadcontent").load($(this).attr("href");
    Where $(this) is a link (obviously, given the href attribute!).

    The problem is on the second line. I assume I'll have to declare $(this).attr("href) as a variable first? If so how? Or is there a cleaner way to do it?

    TIA
    ~The Artist Latterly Known as Crazy Hamster~
    922ee590a26bd62eb9b33cf2877a00df
    Currently delving into Django, GIT & CentOS

  2. #2
    SitePoint Wizard silver trophy TheOriginalH's Avatar
    Join Date
    Aug 2000
    Location
    Thailand
    Posts
    4,810
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Problem solved by looking at another thread

    In case anyone's interested:
    Code:
        var newHref = $(this).attr("href") + "&js";
        $("#loadcontent").load(newHref);
    ~The Artist Latterly Known as Crazy Hamster~
    922ee590a26bd62eb9b33cf2877a00df
    Currently delving into Django, GIT & CentOS


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
  •