Hello and welcome to CertForums.co.uk, here we host free active certification forums with links to the best free resources for Microsoft's MCSA MCSE MCDBA Cisco's CCNA CCDA and CCNP, and CompTIA's A+ Network+ i-NET+ and Security+ certifications in the UK. If you wish to post or use other advanced features you will need to register first. Registration is absolutely free and takes only a few minutes to complete so sign up today!

If you have any problems with the registration process or your account login, please contact support

Go Back   CertForums > Computing Support Forums > Programming & Scripting
Home Forums Register Search Today's Posts Mark Forums Read

Problem with calling JavaScript from a remote site

Post New ThreadReply
 
Thread Tools Display Modes
  #1  
Old 26-Mar-2008, 02:28 AM
tripwire45's Avatar
tripwire45 tripwire45 is online now
Administrator
Posts: 13,256
Points: 3773 tripwire45 has over 3000 pointstripwire45 has over 3000 pointstripwire45 has over 3000 pointstripwire45 has over 3000 pointstripwire45 has over 3000 pointstripwire45 has over 3000 pointstripwire45 has over 3000 pointstripwire45 has over 3000 pointstripwire45 has over 3000 pointstripwire45 has over 3000 pointstripwire45 has over 3000 points
Power: 179
None
Join Date: 29 Jun 2003
Location: Boise, ID, USA
Certifications: A+ and Network+
Problem with calling JavaScript from a remote site

I created and support the website for my congregation. As part of the site, I wanted to display the Jewish as well as the "regular calendar" and candle lighting times for the Sabbath. I found a site that allows anyone to use their JavaScript calendars and add them to their websites as long as credit is properly given (which it has).

I've never had a problem with it before until the other day. Apparently, the server hosting the required JavaScript was down and the result is none of the pages on my site that uses that code (just about all of them do) would load. The pages parse from top to bottom, so the minute a browser tried to parse the section with the required JavaScript, the remote server was accessed...only this time because that server was apparently down, the information couldn't be retrieved.

The result is that my page wouldn't load any more than the section containing the code that called the calendar information. I was stuck.

The remote server is up again but I was wondering if there was a way to write something in JavaScript that said something like:

If this information isn't retrieved in 20 seconds (or whatever), ignore it and proceed with parsing the rest of the webpage.

I know what you're thinking. You're thinking "why not just copy and paste the required JavaScript onto the web server hosting my site so it'll all be local?" As I recall, that's not part of the licensing agreement for using this code. Yes, that would be the easiest thing to do, though.

Here are the two sections of JavaScript from my index page that require access to the remote server:
Code:
<script type="text/javascript" language="JavaScript" src="http://www.hebcal.com/etc/hdate-en.js"></script>
Code:
<h3><a name="localtime"></a>Shabbat Candle Lighting and Havdalah Times for Boise</h3>

<script type="text/javascript"

src="http://www.hebcal.com/shabbat/?geo=zip;zip=83706;m=44;cfg=j">

</script>

<noscript>

<!-- this link seen by people who have JavaScript turned off -->

<a href="http://www.hebcal.com/shabbat/?geo=zip;zip=83706;m=44">Shabbat

Candle Lighting times for Boise, ID 83706</a>

courtesy of hebcal.com.

</noscript>
Any ideas?

Thanks.


You know, I wish my parents played Mozart when I slept because half the time I don't even know what the heck anyone's talking about!
 
Reply With Quote
  #2  
Old 27-Mar-2008, 04:27 PM
ThomasMc's Avatar
ThomasMc ThomasMc is offline
Longterm Member
Posts: 503
Points: 597 ThomasMc has over 500 pointsThomasMc has over 500 pointsThomasMc has over 500 pointsThomasMc has over 500 pointsThomasMc has over 500 pointsThomasMc has over 500 points
Power: 14
None
Join Date: 04 Dec 2006
Location: Glasgow
Certifications: MCDST
WIP: MCSA (70-270), CCNA, CCNP
have a look here(Run with it and scroll down), am sure you should be able to implament this yourself




 
Reply With Quote
  #3  
Old 27-Mar-2008, 04:51 PM
Mitzs's Avatar
Mitzs Mitzs is offline CertForums News Posting Member
Ducktape Goddess
Posts: 3,197
Points: 2519 Mitzs has over 2500 pointsMitzs has over 2500 pointsMitzs has over 2500 pointsMitzs has over 2500 pointsMitzs has over 2500 pointsMitzs has over 2500 pointsMitzs has over 2500 pointsMitzs has over 2500 pointsMitzs has over 2500 pointsMitzs has over 2500 pointsMitzs has over 2500 points
Power: 63
None
Join Date: 11 Apr 2005
Location: Tenneesse USA
Certifications: Microcomputers and network specialist.
WIP: Adobe DW, PS
Trip, the Hebcal Interactive Jewish Calendar and the 1-Click Shabbat Candle Lighting Times that I found here are both under the Creative Commons license. It allows you to copy it to your website.

Quote:
May I reproduce hebcal.com content in another form (e.g. printed calendars, another website, email newsletter, refrigerator magnets)?
You may reproduce some (not all) hebcal.com content. Each individual page has a Copyright notice at the bottom which says one of the following:

Copyright © 2007 Michael J. Radwin. All rights reserved.
You are forbidden from copying, distributing, redisplaying, or making derivative works of the web page it contains this Copyright notice.


Copyright © 2007 Michael J. Radwin. This work is licensed under a Creative Commons License.
You are permitted to use the work under the terms of the aforementioned license.
Hebcal.com web pages that are available under a Creative Commons license also have this image on the bottom right-hand corner:
http://www.hebcal.com/help/link.html

Look at the bottom of both of these pages.

http://www.hebcal.com/hebcal/

http://www.hebcal.com/shabbat/


“We do not remember days, we remember moments.” Cesare Pavese

Twitter: http://www.twitter.com/mitzs
 
Reply With Quote
Post New ThreadReply Spread this thread: Submit this thread to digg Submit this thread to del.icio.us


Go Back   CertForums > Computing Support Forums > Programming & Scripting


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Managing Remote Routers over a VPN Tunnel tripwire45 News 0 14-Dec-2007 01:45 PM
Remote assistance frustration: MS press book simply doesn't help csh Server Exams 4 17-Oct-2007 04:27 PM
Review: Beginning JavaScript 3rd Edition tripwire45 Reviews 0 24-May-2007 10:10 PM
Strange internet problem. please help Dazza30 Connectivity, Telecommunications & the Internet 18 05-Sep-2006 10:25 PM


All times are GMT. The time now is 05:30 PM.

Powered by vBulletin® Version 3.6.10
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
CertForums.co.uk (C) copyright 2003-2007 All Rights Reserved. Content published on CertForums.co.uk requires permission for reprint.
Hosted by Lunarpages