Simple Path Problem

I’ve run into a bit of problem defining a path to a script. Normally, this wouldn’t seem like it would be a problem but I can’t quite get it working right now.

I have 2 pages.
Page1.html
graph.html

And 1 Javascript
Javascript.js

Page 1
Has a link with the following onclick:

onclick="return GB_showCenter('Data Graph',createGraph('tag'),340,820)"

At this point I have a function called createGraph which returns a url value which will be used in the GB_showCenter function. createGraph() is in the javascript and looks like this:

function createGraph(tag) {
    var string = "";
    
    var checkboxes = document.getElementsByName(tag+"-checkbox");
    for(var i=0; i<checkboxes.length;i++){
        if(checkboxes[i].checked){
            if(string != "") string += "&";
            string += checkboxes[i].getAttribute("class")+"="+checkboxes[i].value;
        }
    }
    var url = location.href;
    url = url.split("/");
    url.pop();
    var urlString = url.join("/");
    urlString += "/graph.html?"+string;
    return urlString;
}

originally I just had it returning

return "graph.html?"+string;

However, this did not work so I added the complex URL parsing approach above. It outputs the correct URL but I believe I’m running into problems where the browser thinks I’m running cross-domain when in fact all files are in the same directory on my computer.

What am I doing wrong? All I want to do is return a link to the graph.html page with the correct GET variables.

Thanks for your help.

Well I switched from the javascript library to the jquery library of greybox and it seemed to solve the issue. I don’t know what was going on originally though.

At this time I am unable to host the page I’m working online. Here is some more info that may be helpful.

I’m using the Javascript Libary Greybox to create a popup. Greybox will display an exterior url in this popup.
I want to use greybox to display another page in my website graph.html. However, before I send it the graph URL I want to attach GET variables to the URL from form data on the page that calls the greybox.

This is the error I keep running into with my URL.
Permission denied for <file://> to get property Window.GB_CURRENT from <file://>.

This seems to be a cross-domain issue but I could be wrong about that. Also, I’m running this locally on my machine so that is while you see the file protocol.

It is difficult to determine, from what you have posted here.

However, if you provide us with a link to a test page that demonstrates the problem, it will be much easier for us to work out what’s going on.