PDA

View Full Version : Please check this function


DrunkPanda
09-18-2004, 08:55 AM
can somebody please help me on this



var get_url;
function package_cookies(){

// soem other codes here

for (var x=0; x<pc_broken_cookie2.length -1;x++){
get_url=pc_broken_cookie2[x].split("|")[1];
w.document.write("<li><a href=# onClick='parent.right_frame.location=news_list(get_url)';><font size=4 face=georgia>"+pc_broken_cookie2[x].split("|")[0]+"</font></a>");
}//end for
w.document.write("</ul></body>");

}

function news_list(){
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.load(get_url);
var titleTAG = xmlDoc.getElementsByTagName("title");
var urlTAG = xmlDoc.getElementsByTagName("url");
var linkTAG = xmlDoc.getElementsByTagName("link");

for (var i=0;i<titleTAG.length;i++)
{
document.write(" Title:" );
document.write(" <a href = " +linkTAG[i].text+ " target=_blank>" +titleTAG[x].text+ "</a><br>");
document.write("<br>");
}
}

Mr J
09-18-2004, 06:57 PM
Don't you need some quotes in there?


w.document.write("<li><a href=# onClick=parent.right_frame.location='slashdot.html';><font size=4 face=georgia>Slashdot</font></a>");

DrunkPanda
09-18-2004, 11:37 PM
Don't you need some quotes in there?


w.document.write("<li><a href=# onClick=parent.right_frame.location='slashdot.html';><font size=4 face=georgia>Slashdot</font></a>");



thank you for reply
this is little embarrassing here, it works, but I remembered I have have tried that but anyway thank you and may also ask you to teach me how to quto this one 'news_list(get_url)'


w.document.write("<li><a href=# onClick=parent.right_frame.location='news_list(get_url)';><font size=4 face=georgia>"+pc_broken_cookie2[x].split("|")[0]+"</font></a>");


what I am try to do is, variable "get_url" contains a URL which has been typed from a user, and I want to get this variable from function package_cookies() to functin news_list() and then put the variable into "xmlDoc.load(get_url);"

thank you