Windows server - external javascript?
Hello!
It's been a long time since I've been here!!
I'm working on a website and I'm trying to see if I can include and execute a javascript file hosted on another server on my server instead of on the client. Can this be done? Here's what I'm trying
news.asp:
<script runat=server language=javascript src=http://www.news4sites.com/service/newsfeed.php?tech=js&id=397></script>
etc...
I'm guessing that you aren't allowed to do that on a Windows (or other?) server?
I have javascript that runs on other .asp pages.
Thanks!
Peter
Touchup image processing applet
Pixel Development Web Design, Photography
Suzanne posted this at 04:51 — 24th February 2004.
She has: 5,507 posts
Joined: Feb 2000
You can load javascript from any place that allows you to.
http://www.news4sites.com/service/newsfeed.php?tech=js&id=397 is available for browsing.
<script src=http://www.news4sites.com/service/newsfeed.php?tech=js&id=397></script>
<script type="text/javascript">
... you're missing this part that actually displays the data acquired by the first script.
</script>
Of course, one wonders why you wouldn't use the asp option...
Anyway, it's always better to ask the people providing the feed on how to implement it.
Mark Hensler posted this at 08:37 — 24th February 2004.
He has: 4,048 posts
Joined: Aug 2000
I don't believe so.
You might look into downloading the file in a sheduled job (I think that is windows equivalent to cron jobs?). Then you should be able to runat=server on your localhost.
Mark Hensler
If there is no answer on Google, then there is no question.
pmj7 posted this at 14:04 — 24th February 2004.
He has: 234 posts
Joined: Nov 2002
Hi
Thanks, Suzanne, I found out about the alternate method of getting the feed later in the day. For other services/scripts, downloading them periodically to the server sounds like a good solution!
Thank you both!
Peter
Touchup image processing applet
Pixel Development Web Design, Photography
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.