Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Ajax include on other domain
Old 01-12-2011, 05:29 PM Ajax include on other domain
Nightmaster's Avatar
Average Talker

Posts: 26
Name: Nikola
Location: Serbia
Trades: 0
Hello there.
Im using Ajax ticker script found here:
Code:
http://www.dynamicdrive.com/dynamicindex17/rsstickerajax/index.htm
What i want to do is to include output on some other domain (site). I try that, but it wont work. I added this code to other site:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="http://samo-opusteno.info/servisi/style.css" />
<script src="http://samo-opusteno.info/servisi/vesti.js" type="text/javascript">
//vesti by samo-opusteno.info
</script>
</head>

<body>
<div style="height: 225px">
<script type="text/javascript">
new opusteno_vesti("SO", 1000, "vestiopis2", "box2", 8000, "description")
</script>
</div>

<div style="height: 225px">
<script type="text/javascript">
new opusteno_vesti("SO", 1000, "vestiopis", "box2", 8000, "date+description")
</script>
</div>

<div style="height: 225px">
<script type="text/javascript">
new opusteno_vesti("SO", 1000, "vest", "box1", 3000, "date")
</script>
</div>
<div style="height: 225px">
<script type="text/javascript">
new opusteno_vesti("SO", 1000, "opusteno", "box1", 3000, "")
</script>
</div>

</body>
</html>
That code work wherever i add it on my domain where script files are, but wont work on other domain.

In head u can see that js script is called:
Code:
http://samo-opusteno.info/servisi/vesti.js
And there (in that js file on server) is a code:
Code:
//Relative URL syntax:
var lastrssbridgeurl="http://samo-opusteno.info/servisi/lastrss/bridge.php"

//Absolute URL syntax. Uncomment below line if you wish to use an absolute reference:
var lastrssbridgeurl="http://"+window.location.hostname+"/servisi/lastrss/bridge.php"
And thats the problem. It never loads the right "bridge.php" file because of that. I dont know how to set the right path so that file will be included on other domains too...

Any help would be appreciated.

Regards.
Dzonny
Nightmaster is offline
Reply With Quote
View Public Profile Visit Nightmaster's homepage!
 
 
Register now for full access!
Old 01-13-2011, 08:00 AM Re: Ajax include on other domain
phpdasan's Avatar
Experienced Talker

Posts: 37
Name: Karthick B
Trades: 0
May be this will help..


http://snook.ca/archives/javascript/cross_domain_aj
__________________
There is no secret ingredient.
phpdasan is offline
Reply With Quote
View Public Profile
 
Old 01-13-2011, 05:07 PM Re: Ajax include on other domain
Nightmaster's Avatar
Average Talker

Posts: 26
Name: Nikola
Location: Serbia
Trades: 0
Ive looked at that link, but im not familiar with jquery, and i still cant find a way to do this.
Nightmaster is offline
Reply With Quote
View Public Profile Visit Nightmaster's homepage!
 
Reply     « Reply to Ajax include on other domain
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.32954 seconds with 12 queries