sending array name through

  • hakexp
  • Born
  • Born
  • hakexp
  • Posts: 1

Post 3+ Months Ago


using php to write a link which opens a pop-up window.
Within the parameters there window name that gets sent is an array


Is there a rule that states arrays cannot be sent through a function call for a You can't have spaces, but what about []

<a href="#" onClick=""test.html","projectName[<?echo x;?>]?>","220","220")>pop-up</a>

Any ideas?
  • RichB
  • Guru
  • Guru
  • User avatar
  • Posts: 1121
  • Loc: Boston

Post 3+ Months Ago

This is very odd. Whenever I try to send any non-alphanumeric character in the second string argument of I get invalid argument. On the other hand there seems to be no objection to assigning a string containing a non-alphanumeric directly to the property, so in an attemp to get around the invalid argument I tried creating the new window with a blank string for the second arg and then assigned the new value to it directly and that seemed to work.

Code: [ Select ]
<script type="text/javascript">
function openwindow(fileName, winName)
    win =,"","width=220,height=220") = winName;
<a href="#" onClick="openwindow('test.html','projectName[<? echo $x; ?>]')">pop-up</a>
  1. <?
  2. $x=5;
  3. ?>
  4. <html>
  5. <head>
  6. <script type="text/javascript">
  7. <!--
  8. function openwindow(fileName, winName)
  9. {
  10.     win =,"","width=220,height=220")
  11. = winName;
  12. }
  13. //-->
  14. </script>
  15. </head>
  16. <body>
  17. <a href="#" onClick="openwindow('test.html','projectName[<? echo $x; ?>]')">pop-up</a>
  18. </body>
  19. </html>

I put an alert box inside my test.html file to make sure that the value was assigned and it showed correctly.

Code: [ Select ]
blah blah
  1. <html>
  2. <head>
  3. <title>
  4. blah blah
  5. </title>
  6. <script>
  7. alert(;
  8. </script>
  9. </head>
  10. <body>
  11. blah
  12. </body>

I haven't been able to find documentation of the non-alphanumerics in the second string argument anywhere.

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 31 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum

© 1998-2017. Ozzu® is a registered trademark of Unmelted, LLC.