views:

19

answers:

0

Hi I am learning to use the Jquery Address plugin, and am using the tutorial over here

So here is the html

<a href="test1.html" rel="address:/test1">Test 1</a><br />
<a href="test2.html" rel="address:/test2">Test 2</a>

Load Area: <br />
<div id="area"></div>

And here is the Jquery code

function loadURL(url) {
        $("#area").load(url);
    }


    // Event handlers
    $.address.init(function(event))
.change(function(event) {
        $("#area").load($('[rel=address:' + event.value + ']').attr('href'));
    })

    $('a').click(function(){
        loadURL($(this).attr('href'));
    });

Now this works well. However I want to do a POST call on the back button. So I replace

$("#area").load($('[rel=address:' + event.value + ']').attr('href'));

with

var myhref = $('[rel=address:' + event.value + ']').attr('href');
$.post(myhref, function(data) {
        $('#area').html(data);
    });

This throws the console error "this.value is not a function".

Considering my very superficial knowledge of Jquery (& programming in general), what am I doing wrong here?