Q:

jquery set base href

I'm trying to set the base href with JQuery by reading a PHP file. 
Why does $("base").load("ip.php"); work but $("base[property='href']").load("ip.php"); doesn't? 
Of course what I need is to set the href parameter only, not the content of base. 
I found I could get it working by using $("head").load("ip.php"); but would like to know why above isn't working. 

A:

Try something like this to set href value
   $('base').attr('href','http://www.google.com');

Its depend how your file ip.php is
For example
ip.php 
<? php 
   echo 'http://www.google.com';

? >

Then 
$.get('ip.php',function(response){
    $("base").attr("href", response);
});

