The Lodge is members-only design/dev videos and Office Hours.

Next Office Hours Session: "Implementing an SVG Icon System" Nov 30 - 6:00 PM Eastern

jQuery, AJAX, and mediawiki

  • # September 20, 2008 at 1:02 pm

    I’m usually able to find this stuff on my own, but this doesn’t look like a quick fix.

    Let’s say I wanna AJAXify my Mediawiki installation by using jQuery:


    How do I get the url of the anchor into the .load argument? My first instinct is to use a variable, obviously, but I have no idea how to extract the url of the anchor and set it as var URL, or if I can use it as an argument in .load().

    I’ve never used the css-tricks community as a resource before, so let’s see what you guys can do. :D

    # September 21, 2008 at 5:54 am

    Haven’t tested it, but thwat you think of this.href ?

    # September 21, 2008 at 11:13 am

    This reply has been reported for inappropriate content.

    The href is just an attribute of the anchor element. So yeah, you can set a variable if you’d like:

    var path = $("a").attr("href");



    I didn’t test either, but that’s the theory.

    # September 25, 2008 at 9:47 pm
    var path = $(“a”).attr(“href”);

    :( Didn’t work. I just ended up simplifying and minimalizing the design of the wiki, and then linking to it from an iframe in a wordpress page. Works fine. Thanks though, I’m gonna have to find a way to put this $("a").attr("href"); bit of code to good use. ;)

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed