/    Sign up×
Community /Pin to ProfileBookmark

opening a window in javascript with php

I know this is written in php but the question has more to do with javascript.

the code

[code]

<script>
var filepath;
filepath = “../details/branddetails.php?id=$id”;
</script>

<A HREF=”java script:newwindow()”>$id</A>

<SCRIPT language=JavaScript>
function newwindow()
{
window.open(‘filepath’,”,’width=”10″,height=”10″,resizable=no, scroolbars=no, toolbar=no, status=no, menubar=no’);
}
</SCRIPT>
[/code]

This code is located in the main directory. The details files are located in a child directory. The include file is being called from a file in a child directory. But everytime I click to open a new window I get a file can not be found error.

If i call the inclide file from a script in a child dir and the define files are in a different child dir, I would have to regress to the parent then go to the define directory. am I correct in thinking this. Even though the include file is in the main directory links and what now will be traveled from the file that called it. Does anybody have any idea of why this is happening.

does the javascript part look correct and does anybody know of any javascript/php issues when trying to open a new window.

any help, howtos, flames, etc are gladly welcomed

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@A1ien51Feb 24.2005 — It would be a lot easier to look at the code if you would show us the code after the php has run. AKA view source...

Eric
Copy linkTweet thisAlerts:
@DARTHTAMPONauthorFeb 24.2005 — stripped the php, let me know what you think
Copy linkTweet thisAlerts:
@UltimaterFeb 25.2005 — <SCRIPT language=JavaScript>

function newwindow()

{


window.open([color=green]filepath[/color],'','width="10",height="10",resizable=no, scroolbars=no, toolbar=no, status=no, menubar=no');

}

</SCRIPT>

&mdash;Cheers
×

Success!

Help @DARTHTAMPON spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...