Hi all!
It is a function, that searches for a predifined word.
If it is found, generate a predifined page.
The predifined word and the predifined page is in an array called wl.
The script ends up the function both locally and on a remote server.
Problem occurs only on the remote server, only if a word found.
The problem is that the actual browser window does not respond instead of generating the predifined page.
It should fail at this block:
Code:
this.window.document.open();
this.window.document.write(html1);
this.window.document.write(wl[c]);
this.window.document.write(html3);
this.window.document.close();
I think it is syntactically correct, because it works locally.
The problem is in the array data, I think.
wl[c] is too big.
There should be a timeout.
Here is all the code i use:
Code:
//Search and mactch the query
function search01(){
wl = new Array()
wl[0]="julianna apartment:<br /><br /></td></tr><tr><td height='30' colspan='4' valign='middle' align='center'><form name='lastminutebooking_apartments_search12' action='javascript:search();'><input type='text' name='apartments12' class='quicksrchselectfields11' style='height: 25px; background-color: #FFFFFF; border-width: 3px;'> <input type='submit' name='search_apartment' value='search apartment!' class='quicksrchbuttons11' style='width: 150px; height: 25px; border-width: 3px;' ></form></td></tr><tr><td height='50' colspan='4' valign='middle' align='center' class='linebreak0'><a href='http://www.lastminutebooking.freeweb.hu/index.htm' target='_self' >« back to the lastminutebooking apartments</a></td></tr><tr><td colspan='1' valign='middle' align='left'><form name='lastminutebooking_apartments11' id='lastminutebooking_apartments11' ><br /><select name='apartments11' id='apartments11' onchange='javascript:search();' class='quicksrchselectfields11' ><option selected='selected' > select apartment </option><option value='fiumei' > Fiumei </option><option value='julianna' > Julianna </option><option value='saint-stephen' > Saint-Stephen </option><option value='danube 1.' > Danube 1. </option><option value='danube 2.' > Danube 2. </option><option value='danube 3.' > Danube 3. </option><option value='danube 4.' > Danube 4. </option><option value='danube 5.' > Danube 5. </option><option value='danube 6.' > Danube 6. </option><option value='danube 7.' > Danube 7. </option><option value='danube 8.' > Danube 8. </option><option value='danube 9.' > Danube 9. </option><option value='danube 10.' > Danube 10. </option><option value='danube 11.' > Danube 11. </option><option value='danube 12.' > Danube 12. </option></select></form></td><td colspan='3' valign='middle' align='left'><span style='font-size: 14px;' >14. APARTMENT » JULIANNA APARTMENT » </span><a href='lastminutebooking.htm' style='font-size: 14px;' >LASTMINUTEBOOKING</a></td></tr><tr><td height='100' colspan='4' valign='middle' align='center' class='pictureframe12'><a name='14'>A few steps from the Danube shore, at the leg of the monumental Parliament, a familiar apartment awaiting it\'s guests.<br />One of the rooms is this double room.<br />There is possibility to use the internet, computer programs and fax.<br />A lot of facility resorts are nearby, for example: <br />parking, restaurant, shopping, museums, pedestrian zone, discotheque, thermal bath, beach.</a></td></tr><tr><td width='236' rowspan='2' colspan='1' valign='middle' align='center' class='pictureframe12' name='app_roomid'>Julianna apartment<br />suite<br />4 seats<br />address : Alkotmany str. 20.<br />owner:<br />Mr. Zoltan Ludanyi<br />contact:<br /><a href='mailto:zlotyi@yahoo.com?subject=lastminutebooking' style='font-size: 13px;'>zlotyi@yahoo.com</a><br /><a href='lastminutebooking.htm' style='font-size: 13px'>lastminutebooking</a></td><td rowspan='2' colspan='1' valign='middle' align='center' class='pictureframe12'><img align='middle' width='220' height='200' border='0' src='A001/thumb/R001.jpg' /></td><td border='0' width='200' rowspan='2' colspan='1' valign='middle' align='center' class='pictureframe12'><a href='main_map_julianna.htm' target='_self'><img align='middle' border='0' src='map_julianna.jpg' /></a></td><td width='226' height='160' colspan='1' valign='middle' align='center' class='pictureframe12'><span class='pricelistheader10'>general pricelist</span><br /><span class='pricelistheader11'>1 person</span><br /><span class='pricelist11'>25 EU/apartment/night</span><br /><span class='pricelistheader11'>2 person</span><br /><span class='pricelist11'>35 EU/apartment/night</span><br /><span class='pricelistheader11'>3 person</span><br /><span class='pricelist11'>45 EU/apartment/night</span><br /><span class='pricelistheader11'>4 person</span><br /><span class='pricelist11'>60 EU/apartment/night</span><br /><span class='pricelistheader11'>cleaning, utilities, taxes included</span></td></tr><tr><td colspan='1' valign='middle' align='center' class='pictureframe12'><a href='lastminutebooking.htm'>lastminutebooking »</a></td></tr><tr><td height='50' colspan='5' valign='middle' align='center' class='pictureframe12'><span class='facilitydescription13'>satellite tv, web access, telephone, an equipped kitchenette with fridge, owen, separate bathroom and toilet, together with a key to the apartment.</span></td></tr><tr><td colspan='5' height='50' valign='middle' align='center' ><span style='font-size: 16px; color= #0000FF;' ><br />The apartment can be seen here:</span><br/>[list]<a href='http://www.lastminutebooking.freeweb.hu/A001/A001_R001_PIC.htm' target='_self' style='font-size: 16px; color= #0000FF;' >> julianna apartment</a></ul></td></tr><tr><td height='50' colspan='4' valign='middle' align='center' class='linebreak0'><a href='http://www.lastminutebooking.freeweb.hu/index.htm' target='_self' >« back to the lastminutebooking apartments</a></td></tr>";
wl[1]="glossary: - an alphabetical list of technical terms in some specialized field of knowledge usually published as an appendix to a text on that field";
wl[2]="keyword: - A summarizing word or phrase in a document or record that is used in sorting and searching. (2) (n.) A word or symbol that has a specific meaning in a programming-language statement. Also called reserved word. ";
wl[3]="path: - A path can be described as a file's address on your file system, describing where the file lives: An absolute path gives the complete path, starting at the root directory, or the very top of the filesystem A relative path looks for a file from the directory you are currently in down.";
html1 = "<HTML><Head><meta http-equiv='Content-Language' content='en-gb'><meta http-equiv='Content-Type' content='text/html, charset=windows-1252'><title>WWW.LASTMINUTEBOOKING.FREEWEB.HU - LASTMINUTEBOOKING APARTMENT SEARCH</title><link href='lastminutebooking.net2.css' rel='stylesheet' type='text/css' /><Script Language='Javascript1.2' SRC='js/glossary1.js' type='text/javascript'></Script></Head><Body style='background-color:#FFFFCC'><table width='905' border='0' cellspacing='1' cellpadding='1' align='center' ><tr><td colspan='4' valign='middle' align='center' class='availheader12' style='font-size: 18px;'><br /><br />";
html3="<tr><td height='40' colspan='4' valign='bottom' align='center' ><a href='#top' target='_self' style='font-size: 18px; color: #0000FF;'>:: < back to the top of this page > ::</a></td></tr><tr><td height='40' colspan='4' valign='middle' align='center' ><a href='http://www.lastminutebooking.freeweb.hu/index.htm' target='_self' style='font-size: 18px; color: #0000FF;'>www.lastminutebooking.freeweb.hu, the lastminutebooking company. All rights reserved.</a></td></tr><tr><td height='20' colspan='4' valign='middle' align='center'><img align='middle' src='http://freeweb.hu/counter?username=lastminutebooking&type=4'></td></tr></table></Body></HTML>";
myWord1=document.lastminutebooking_apartments.apartments_selection.value;
myWord1.toLowerCase();
flag = 0;
for(c=0; c < wl.length; c++){
currentWord = wl[c].split(" ");
if(currentWord[0] == myWord1){
this.window.document.open();
this.window.document.write(html1);
this.window.document.write(wl[c]);
this.window.document.write(html3);
this.window.document.close();
// alert(" MyWord now = " + wl[c]);
flag = 1;
}
}
if(flag==0)
{
alert("The access to the apartment is actually denied, please revisit the site later!");
}
}//end of fun
How can i solve it?