Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with popup window when filename has a space 1

Status
Not open for further replies.

IPGuru

Vendor
Jun 24, 2003
8,391
1
38
GB
I seem to have a problem with some javascript inserted by PHP (I am reasonably certain mey error is in the javascript not the PHP code which is why I am posting here

Code:
<script type='text/javascript'>
window.open('dealer/Dealer Name','Dealer Name','width=800,height=600');
</script>
[code]

whare Dealer Name can change depending on my actual database

this works when Dealer Name does not contain any spaces but I get an error with script on page when the name includes spaces.
 
>window.open('dealer/Dealer Name','Dealer Name','width=800,height=600');
[tt]window.open(encodeURI('dealer/Dealer Name'),'Dealer[highlight]_[/highlight]Name','width=800,height=600');[/tt]

ps: eliminate any space in the name (2nd param); underscore is just suggestive.
 
I Thanks I will give that a try, (had to read the sugestion twice before I realised what it was)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top