/    Sign up×
Community /Pin to ProfileBookmark

How does javascript from external website works

I am trying to do something similar to what google AdSense does. Basically I want to provide users with script that they can plug-in to their website. So they can have a protal with information from my website. I am not sure how this is done. I tried looking up information on how to pass in variables to my javascript file from users page (on different domain).

Here is an example of google adsese..

<script type=”text/javascript”><!–
google_ad_width = 160;
google_ad_height = 600;
…..
//–></script>
<script type=”text/javascript”
src=”http://pagead2.googlesyndication.com/pagead/show_ads.js“>
</script>

They have something like above, from my understanding show_ads.js uses varibles like google_ad_witdh and stuff, which is set in clients html code. I tried to look for how this works on google but didnt find much. Any link or any example on how to invoke js from one domain to another and passing paramenter will be very helpful. Thanks in Advance.

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@A1ien51Nov 13.2006 — It is just like referencing a external javascript file on your own domain.

Eric
×

Success!

Help @UnseenWarrior spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.15,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...