Jump to content

emmaclarke

Members
  • Posts

    38
  • Joined

  • Last visited

emmaclarke's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Fixed the problem:There was code above the <head> section: <!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" xml:lang="en" lang="en"><head> I moved this under the <head> tag: <head><!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" xml:lang="en" lang="en"> The map now works fine. Probably all the web pages have this error.
  2. The web page that works, when opened in firefox and error console shows no errors.The same code that works in that web page I imported into an existing web page, contact.htmI ran error console on that web site and it comes up with "Error in parsing value for property 'width'. Declaration dropped.I scrolled through and did a search on all 'width' and all the properties look fine.
  3. Hi AllI have a web page that just has a google map inserted in it and it works fine.When i embed the same code into an existing web page it doesn't work.Working Code that works fine: <head><!--- Loading the google map api --> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"> </script> <script type="text/javascript"> var map; function initialize() { var myLatlng = new google.maps.LatLng(52.102681,-0.609741); var myOptions = { zoom: 12, center: myLatlng, mapTypeId: google.maps.MapTypeId.ROADMAP } map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); google.maps.event.addListener(map, 'zoom_changed', function() { setTimeout(moveToDarwin, 1500); }); var marker = new google.maps.Marker({ position: myLatlng, map: map, title:"AandB Pots and Pans, Walton Hall, MK7 6AA, Milton Keynes" }); google.maps.event.addListener(marker, 'click', function() { map.set_zoom(14); title:"AandB Pots and Pans, Walton Hall, MK7 6AA, Milton Keynes" }); } function moveToDarwin() { var darwin = new google.maps.LatLng(52.102681,-0.609741); map.set_center(darwin); } </script> </head> <!-- initialise google map ---><body onload="initialize()"> <!--- Google Map --> <br /> <br /> <p> Google Map </p> <div id="map_canvas" style="width: 35%; height: 35%"></div> <div id="footer"> <p>©2008 The Open University</p> </div> </body> </html> The web page that doesn't work: <!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" xml:lang="en" lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/><title> Early Intervention Services </title><link href="index.css" rel="stylesheet" type="text/css"/>[b]<!--- Loading the google map api --> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"> </script> <script type="text/javascript"> var map; function initialize() { var myLatlng = new google.maps.LatLng(52.151239323508314, -0.47666072845458984); var myOptions = { zoom: 12, center: myLatlng, mapTypeId: google.maps.MapTypeId.ROADMAP } map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); google.maps.event.addListener(map, 'zoom_changed', function() { setTimeout(moveToDarwin, 1500); }); var marker = new google.maps.Marker({ position: myLatlng, map: map, title:"AandB Pots and Pans, Walton Hall, MK7 6AA, Milton Keynes" }); google.maps.event.addListener(marker, 'click', function() { map.set_zoom(14); title:"AandB Pots and Pans, Walton Hall, MK7 6AA, Milton Keynes" }); } function moveToDarwin() { var darwin = new google.maps.LatLng(52.151239323508314, -0.47666072845458984); map.set_center(darwin); } </script>[/b]</head>[b]<body onload="initialize()">[/b]<table class="sample" align="center" width="60%" cellpadding="0" cellspacing="0"><tr align="center" height="150"><th width="1%"> </th><th width="15%" valign="center"> <p> Picture 1 </p> </th><th width="40%" valign="top"> <h1> Early Intervention Services</h1> <h2> Telephone number: 01234 111111 Fax number: 01234 222222<br /> Address - Bedford </h2></th></tr><tr valign="center" height="20"><td width="1%" bgcolor="#33FFCC"> </td><td width="15%" onMouseOver="this.bgColor='#33FFCC'" onMouseOut="this.bgColor='#FFFFFF'"> <a href="index.html" style='text-decoration: none;'> <b> Home Page </b> </a> </td><td width="40%" rowspan="12" valign="top"> <h3> How to contact us </h3> <br /> <p> We can be contacted on 01234 315690 on a Monday to Friday between 9am and 5.00pm. There is an ansaphone for out of office hours.</p><h3> How to get help urgently if you are feeling distressed and are having problems coping. </h3><p>If you need urgent help when our offices are closed (we are closed between 5.00pm and 9am), you should call: <ul><li> your GP at your local surgery or</li><li> the Emergency Duty Team on 0870 2385465 </li></ul><p>You could also call the Samaritans on 01234 211211 (24 hour support)</p> </p> </td></tr><tr valign="center" height="20"><td width="1%" bgcolor="#FF33CC"> </td><td width="15%" onMouseOver="this.bgColor='#FF33CC'" onMouseOut="this.bgColor='#FFFFFF'"> <a href="treatment.htm" style='text-decoration: none;'> <b> Treatment </b> </a> </td></tr><tr valign="center" height="20"><td width="1%" bgcolor="#00FFFF"> </td><td width="15%" onMouseOver="this.bgColor='#00FFFF'" onMouseOut="this.bgColor='#FFFFFF'"> <a href="referral.htm" style='text-decoration: none;'> <b> Referral </b> </a> </td></tr><tr valign="center" height="20"><td width="1%" bgcolor="#CC0000"> </td><td width="15%" onMouseOver="this.bgColor='#CC0000'" onMouseOut="this.bgColor='#FFFFFF'"> <a href="psychosis.htm" style='text-decoration: none;'> <b> What is Psychosis? </b> </a> </td></tr><tr valign="center" height="20"><td width="1%" bgcolor="#339999"> </td><td width="15%" onMouseOver="this.bgColor='#339999'" onMouseOut="this.bgColor='#FFFFFF'"> <a href="how.htm" style='text-decoration: none;'> <b> How We Can Help </b> </a> </td></tr><tr valign="center" height="20"><td width="1%" bgcolor="#9966FF"> </td><td width="15%" onMouseOver="this.bgColor='#9966FF'" onMouseOut="this.bgColor='#FFFFFF'"> <a href="family.htm" style='text-decoration: none;'> <b> Family </b> </a> </td></tr><tr valign="center" height="20"><td width="1%" bgcolor="#CCCC99"> </td><td width="15%" onMouseOver="this.bgColor='#CCCC99'" onMouseOut="this.bgColor='#FFFFFF'" > <a href="contact.htm" style='text-decoration: none;'> <b> Contact Us </b> </a> </td></tr><tr valign="center" height="20"><td width="1%" bgcolor="#CCCC99"> </td><td width="15%" onMouseOver="this.bgColor='#CCCC99'" onMouseOut="this.bgColor='#FFFFFF'" > <a href="links.htm" style='text-decoration: none;'> <b> Links </b> </a> </td></tr><tr valign="center" height="20"><td width="1%" bgcolor="#CCCC99"> </td><td width="15%" onMouseOver="this.bgColor='#CCCC99'" onMouseOut="this.bgColor='#FFFFFF'" > <a href="leaflet.htm" style='text-decoration: none;'> <b> Leaflets </b> </a> </td></tr><tr valign="center" height="300"><td width="1%"> </td><td width="15%"> <img border="0" src="NHSDirect.jpg" /></td></tr><tr valign="center" height="300"><td width="1%"> </td><td width="15%"> <p> Picture 3 </p> </td></tr><tr valign="center" height="300"><td width="1%"> </td><td width="15%"> <p> Picture 4 </p> </td></tr><tr valign="right" height="5" bgcolor="#3399CC" ><td colspan="3" align="right"> <h4> <a href="index.html"><font color="white"> <b>Home Page</b></font></a> | <a href="form.html"><font color="white"><b>Contact Us</b></font></a> </h4> </td></tr></table>[b]<!--- Google Map --> <br /> <br /> <p> Google Map </p> <p> <div id="map_canvas" style="width: 35%; height: 35%"></div> </p> [/b]</body></html>
  4. It still hits the same condition == [0] = M [1] = K [2] = 1 so:text[2] == "1" && text[3] == " " should by pass this so that MK1 is not the same as MK16 since the condition was just checking the first 3 chars. i.e. MK1 is true in the case of MK1 and MK16.I will see if this works.
  5. Actually the alert message shows because inputting "MK16" == [0]=="M" && [1] == "K" && [2] == "1".So I need:[0] == M && [1] == K && [2] == 1,2,3,4,5,6,7,8,9 OR [2] == 1 && [3] == 0 (11,12,13,14,15,17,19) OR [2] ==7 && [3] == 7.I did try this but the OR || statements didn't work - the postcode should be MK1-15, MK17, MK19 or MK77. //conditions on beginning of the postcode to receive a special gift message, verifying each array element in the string for the position of the postcode if ((((((text[0] == "M" || text[0] == "m") && (text[1] == "K" || text[1] == "k") && (text[2] == "1" || text[2] == "2" || text[2] == "3" || text[2] == "4" || text[2] == "5" || text[2] == "6" || text[2] == "7" || text[2] == "8" || text[2] == "9") || (text[2] == "1" && text[3] == "0" || text[2] == "1" && text[3] == "1" || text[2]== "1" && text[3] == "2" || text[2] == "1" && text[3] == "3" || text[2] == "1" && text[3] == "4" || text[2] == "1" && text[3] == "5" || text[2] == "1" && text[3] == "7" || text[2] == "1" && text[3] == "9") || (text[2] == "7" && text[3] == "7")))))) { alert("you will receive a special gift"); } The OR statements between the third brackets onward doesn't seem to work.
  6. if ((((text[0] == "M" || text[0] == "m") && (text[1] == "K" || text[1] == "k") && (text[2] == "1" || text[2] == "2" || text[2] == "3" || text[2] == "4" || text[2] == "5" || text[2] == "6" || text[2] == "7" || text[2] == "8" || text[2] == "9")))) { alert("you will receive a special gift"); } if ((((text[0] == "M" || text[0] == "m") && (text[1] == "K" || text[1] == "k") && (text[2] == "1" && text[3] == "0" || text[2] == "1" && text[3] == "1" || text[2]== "1" && text[3] == "2" || text[2] == "1" && text[3] == "3" || text[2] == "1" && text[3] == "4" || text[2] == "1" && text[3] == "5" || text[2] == "1" && text[3] == "7" || text[2] == "1" && text[3] == "9")))){ alert("you will receive a special gift"); } For some reason if i enter MK16 16AB i get the alert message when there is no condition for text[2] == 1 && text[3] == 6
  7. div.jdSlideshow{width: 400px;height: 200px;float: right;} This works thank you.
  8. <div class="jdSlideshow" id="mySlideshow"></div> div.mySlideshow{width: 400px;height: 200px;float: right;} The image is not being aligned right for some reason. I did exactly the same coding in CSS (div.map_canvas) and HTML (div id) for a google map and that works.
  9. //conditions on beginning of the postcode to receive a special gift message, verifying each array element in the string for the position of the postcode if ((((text[0] == "M" || text[0] == "m") && (text[1] == "K" || text[1] == "k") && (text[2] == "1" || text[2] == "7") && (text[3] == "7" || text[3] == "1" || text[3] == "2" || text[3] == "3" || text[3]== "4" || text[3] == "5")))) { alert("you will receive a special gift"); } the parentheses are now correct and is working.
  10. I think its because it doesn't know or hasn't reached text[1] [2] [3] yet.
  11. //conditions on beginning of the postcode to receive a special gift message, verifying each array element in the string for the position of the postcode if ((text[0] == "M" || text[0] == "m") && (text[1] == "K" || text[1] == "k") && (text[2] == "1" || text[2] == "7") && (text[3] == "7" || text[3] == || "1" || text[3] == "2" || text[3] == "3" || text[3]== "4" || text[3] == "5")) { alert("you will receive a special gift"); } } still doesn't work
  12. Ah thanks a lot i would never had known that. I did some programming about 8 years ago in C++ but of course have completely forgotten it.
  13. // using the 5th form element which is the post code element if (i == 5) { //accessing and iterating over the first four characters in postcode for(a = 0; a < 4; a++){ // using this elements value and putting it in variable text i.e. the postcode's value var text = e.value; //split the string up into an array var text = text.split(""); text[a]; alert(text[3]); //conditions on beginning of the postcode to receive a special gift message, verifying each array element in the string for the position of the postcode if (text[0] == "M" || text[0] == "m" && text[1] == "K" || text[1] == "k" && text[2] == "1" || text[2] == "7" && text[3] == "7" || text[3] == || "1" || text[3] == "2" || text[3] == "3" || text[3]== "4" || text[3] == "5") { alert("you will receive a special gift"); } } } There must be something wrong with the : if (text[0] == "M" || text[0] == "m" && text[1] == "K" || text[1] == "k" && text[2] == "1" || text[2] == "7" && text[3] == "7" || text[3] == || "1" || text[3] == "2" || text[3] == "3" || text[3]== "4" || text[3] == "5") statement because it won't even show alert(text[0]) like it was before.If I do this as an if statement :=[/code]//conditions on beginning of the postcode to receive a special gift message, verifying each array element in the string for the position of the postcode if (text[0] == "M" || text[0] == "m"){ alert("you will receive a special gift"); } } }[/code]it will show the alert(text[3]) correct character so i'm not sure if there is something wrong in that IF statement or if it is too long or wrong conditions???
  14. // using the 5th form element which is the post code element if (i == 5) { //accessing and iterating over the first four characters in postcode for(i = 0; i < 4; i++){ text[i]; alert(text[i]); // using this elements value and putting it in variable text i.e. the postcode's value var text = e.value; //split the string up into an array var text = text.split(""); alert(text[3]); //conditions on beginning of the postcode to receive a special gift message, verifying each array element in the string for the position of the postcode if (text[0] == "M" || text[0] == "m" && text[1] == "K" || text[1] "k") { // && text[2] == "1" || text[2] == "7" && text[3] == "7" || text[3] == || "1" || text[3] == "2" || text[3] == "3" || text[3]== "4" || text[3] == "5") { alert("you will receive a special gift"); } } } For some reason I don't think the if(i = 0; i<4; i++){ text[i]; alert(text[i]);} is working because it shows no alert message.
  15. ok I think it can't see text[1] to text[3] as it hasn't looped through all the text yet. I need to modify the if statements and loop through all the indexes before comparing them.
×
×
  • Create New...