[jQuery] Alter Status Message
Hello,
I have a redirect page, but would like to change the status bar message to show only the target link, rather than the full URL. So, links that hit the redirect page are formed like so:
<a href="http://mydomain.com/redirect.cfm?DURL=http://www.realtarget.com/realpage.htm">
http://mydomain.com/redirect.cfm?DURL=http://www.realtarget.com/realpage.htm</a>
What I want to actually show in the status bar is:
<a href="http://www.realtarget.com/realpage.htm">http://www.realtarget.com/realpage.htm
</a>
I was confident that I could easily handle such a task by throwing together a quick little jQuery-powered script, and here's what I came up with:
$(document).ready(function() {
$("#main #welcome a").hover(
function() {
var href = $(this).attr('href');
var a1 = href.split("DURL=");
if (a1 != href) {
window.status = a1[1];
}
}
);
});
On mouseover, the status bar display is not affected. On mouseout, FireBug reports the following error message:
<span class="objectBox objectBox-errorMessage hasTwisty hasBreakSwitch opened">
<div class="errorTitle">g has no properties</div><div class="errorTrace"><div class="objectBox objectBox-stackFrame"><a class="objectLink">handleHover</a>(<a class="objectLink objectLink-object">mouseout clientX=0, clientY=0
</a><span class="arrayComma"></span>)<span class="objectLink-sourceLink objectLink">jquery-packed.js (line 1)</span></div><div class="objectBox objectBox-stackFrame"><a class="objectLink">e</a>(<a class="objectLink objectLink-object">
mouseout clientX=0, clientY=0</a><span class="arrayComma"></span>)<span class="objectLink-sourceLink objectLink">jquery-packed.js (line 1)</span></div><div class="objectBox objectBox-stackFrame"><a class="objectLink">e</a>
()<span class="objectLink-sourceLink objectLink">jquery-packed.js (line 1)</span></div></div><div class="errorSourceBox errorSource-exec"><img src="chrome://firebug/content/blank.gif" title="Break on this error" class="errorBreak">
<span class="errorSource">eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a...</span></div></span>
Any tips/pointers steering me in the right direction would be most appreciated. :)
Thanks,
Matt