PDA

View Full Version : Writing the correct code


laurenhand
06-06-2011, 02:53 PM
I work at a bank and myself and IT takes care of designing and creating our website. Things have been a bit crazy busy for a while but I am trying to make some updates to the homepage that IT isn't able to assist me with right now. I would really like to include the following code to show the weather and google directions on the homepage but we are forced to have a pop up box come up when someone clicks on it that shows it is an external site. I need to tweak the code provided by the weather station and google directions and include our code that shows that it is an external site. Can anyone assist me with this? Here are the codes we are using:


External website message:

<a class="out" href="http://www.savingsbonds.gov/" target="_new" onClick="return confirm('You are now leaving the Savers Bank website. Savers Bank is not responsible for the content of third party sites hyperlinked from this page, nor does it guarantee the products or services offered on third party sites. You should review the privacy statement of a website before you provide personal or confidential information.\n\nProceed to savingsbonds.gov?')">Savings Bonds</a>


Weather:


<a href="http://www.findlocalweather.com/forecast/ma/worcester.html" target="_blank"><img src="http://www.findlocalweather.net/forecast.php?forecast=zandh&pands=worc ester+ma&config=png&alt=hwivzone&hwvbg=green&hwvtc=white (http://www.findlocalweather.net/forecast.php?forecast=zandh&pands=worcester+ma&config=png&alt=hwivzone&hwvbg=green&hwvtc=white)" border="0" alt="Click for the latest Worcester weather forecast."></a>



Google Directions:


<script src="http://www.gmodules.com/ig/ifr?url=http://hosting.gmodules.com/ig/gadg ets/file/114281111391296844949/driving-directions.xml&amp;up_fromLocat ion=&amp;up_myLocations=270%20Main%20Street%2C%20South bridge%2C%20MA%2 001550%20(Southbridge%20Branch)%20%7C%2055%20Main% 20Street%2C%20Sturbr idge%2C%20MA%2001566%20(Sturbridge%20Branch)%20%7C %2035%20Trolley%20Cr ossing%20Road%2C%20Charlton%2C%20MA%2001507%20(Cha rlton%20Branch)%20%7 C%2038%20Auburn%20Street%2C%20Auburn%2C%20MA%20015 01%20(Auburn%20Branc h)%20%7C%206%20North%20Main%20Street%2C%20Uxbridge %2C%20MA%2001569%20( Uxbridge%20Branch)%20%7C%2096%20Worcester%20Street %2C%20North%20Grafto n%2C%20MA%2001536%20(Grafton%20Branch)%20&amp;up_defau ltDirectionsType =&amp;up_autoExpand=&amp;synd=open&amp;w=320&amp;h=55&amp;title=Dire ct ions+by+Google+Maps&amp;brand=light&amp;lang=en&amp;country=US &amp;bor der=%23ffffff%7C3px%2C1px+solid+%23999999&amp;output=j s (http://www.gmodules.com/ig/ifr?url=http://hosting.gmodules.com/ig/gadgets/file/114281111391296844949/driving-directions.xml&amp;up_fromLocation=&amp;up_myLocations=270 %20Main%20Street%2C%20Southbridge%2C%20MA%2001550% 20%28Southbridge%20Branch%29%20%7C%2055%20Main%20S treet%2C%20Sturbridge%2C%20MA%2001566%20%28Sturbri dge%20Branch%29%20%7C%2035%20Trolley%20Crossing%20 Road%2C%20Charlton%2C%20MA%2001507%20%28Charlton%2 0Branch%29%20%7C%2038%20Auburn%20Street%2C%20Aubur n%2C%20MA%2001501%20%28Auburn%20Branch%29%20%7C%20 6%20North%20Main%20Street%2C%20Uxbridge%2C%20MA%20 01569%20%28Uxbridge%20Branch%29%20%7C%2096%20Worce ster%20Street%2C%20North%20Grafton%2C%20MA%2001536 %20%28Grafton%20Branch%29%20&amp;up_defaultDirectionsT ype=&amp;up_autoExpand=&amp;synd=open&amp;w=320&amp;h=55&amp;title=Dir ections+by+Google+Maps&amp;brand=light&amp;lang=en&amp;country =US&amp;border=%23ffffff%7C3px%2C1px+solid+%23999999&amp;o utput=js)"></script>

domedia
06-06-2011, 03:16 PM
Use class="out" like all your other outgoing links. I was able to determine this by simply looking at the links on your web site.

Your IT people, or whoever is responsible for your website should have no problem in assisting you with this. It's just adding 10 characters at the right spot.

laurenhand
06-07-2011, 12:17 PM
Thanks for your reply.
Since the weather and google directions are both gadgets that appear on the homepage (and people don't have to click on something) we will need to put a message on the homepage when they either rollover the gadget with their mouse or go to enter the address for directions. Do you know the code for doing either of those?
For google directions, I imagine we will be compliant if we have a message pop-up when they go to enter their address that says "this is an external site".
For the weather, it may have to be a rollover pop-up message since they don't need to click on it and it's just information. If you could help me with that and knowing where to put it in the code, I would greatly appreciate it. Thanks.

jmichae3
06-14-2011, 06:44 AM
Have you considered using mapquest? they have a "link" field. this is the link for 270 Main St, Southbridge, MA 01550

http://mapq.st/lAk4XY

I simply put it in driving directions as the destination and clicked Get Directions. there are other ways on mapquest to get directions, such as the URL interface.
there is also a way on google maps:

[/URL]http://maps.google.com/maps?q=270+Main+St+Southbridge%2C+Ma.+01550 (http://maps.google.com/maps?q=270+Main+St+Southbridge%2C+Ma.+01550)

[URL]http://www.mapquest.com/maps/270+Main+St+Southbridge+MA+01550/ (http://www.mapquest.com/maps/270+Main+St+Southbridge+MA+01550/)

jmichae3
06-14-2011, 07:06 AM
don't forget your onclick= event handler. that's what makes the popup work. yes, you should have the class="out", but you should especially have the

onClick="return confirm('You are now leaving the Savers Bank website. Savers Bank is not responsible for the content of third party sites hyperlinked from this page, nor does it guarantee the products or services offered on third party sites. You should review the privacy statement of a website before you provide personal or confidential information.\n\nProceed to savingsbonds.gov?')"

the google directions you picked was using <script> tags, so you have no way to warn someone if they click on something (there is no onclick handler). it is simply embedded within the document, and if they click on a restaurant icon, you can't warn them. If this embedded google map is actually approved by your bank, then I would say go ahead and use it. I am being a little nit picky about things in this case.

I can't put full code here because the HTML+CSS forum doesn't allow for tags (could somebody fix that so I am not getting my code replaced by an ellipsis?)