I am using frames on a website. The title link on the title page adds a query string. The link goes to a page with two rows the second has two columns. I want the right column to be changed depending on what the query string is. I have the script to parse the query string here:
The frame is named school and uses this html code:
I want the frame src to be the “PageLocation” variable. How do I do this in Javascript?
The other way is to have the Javascript direct the frame to the correct page but I don’t know how to do this.
Thanks,
Josh
Code:
function getQueryVariable(variable) { var query = window.location.search.substring(1); var vars = query.split("&"); for (var i=0;i<vars.length;i++) { var pair = vars[i].split("="); if (pair[0] == variable) { return pair[1]; } } alert('Query Variable ' + variable + ' not found'); } var PageLocation = "school/"+getQueryVariable("page")+".html"
Code:
<frame noresize frameborder=0 name="school" src="">
The other way is to have the Javascript direct the frame to the correct page but I don’t know how to do this.
Thanks,
Josh
Comment