[web] How to call a link without redirecting a page

Started by
16 comments, last by Mayple 12 years, 9 months ago
window.location reloads/ redirects the page? My boss doesn't want the page to be reloaded
Advertisement
I'm getting somewhere thanks
ok this post is acting all funny

$site = site; // enter the URL for the site http:// included
function bitlyURL($url) {
$headers = get_headers($url, 1);
return $headers['Location'];

}

echo bitlyURL($site);
[font="Arial"]

-Mayple[/font]
I usually just give my 2 cents, but since most of the people I meet are stubborn I give a 1$ so my advice isn't lost via exchange rate.

how is it acting funny? :o
what is the code ^^ doing?

I actually found a way to get the link..but the problem is the XMLHttpRequest
I think it overwrites previous data
for example if i have 2 bitly links only one gets called..the other isn't expanded :S
I did it! Thanks a lot dude and others who replied.
:)

I did it! Thanks a lot dude and others who replied.
:)


Awesome job. Did you just assign a basic array for the values coming from the xHTTP?

-Mayple
I usually just give my 2 cents, but since most of the people I meet are stubborn I give a 1$ so my advice isn't lost via exchange rate.

sorry for the late reply..I never get any notifications.
Yeah, I made an async call using xmlhttp to a php file which used the bitly api to expand the link.
then I jsonified lol to a javascript and echoed it.
The callback function in javascript gets called in a json array format..
But it was your bitly api idea that got me started thanks a lot

sorry for the late reply..I never get any notifications.
Yeah, I made an async call using xmlhttp to a php file which used the bitly api to expand the link.
then I jsonified lol to a javascript and echoed it.
The callback function in javascript gets called in a json array format..
But it was your bitly api idea that got me started thanks a lot



Not a problem :-).

-Mayple
I usually just give my 2 cents, but since most of the people I meet are stubborn I give a 1$ so my advice isn't lost via exchange rate.

This topic is closed to new replies.

Advertisement