Page 1 of 1

Pop Up

Posted: Fri May 20, 2011 2:14 am
by toqi786
Hey

is there a way to click on a link and get a pop up, i am using javascript and php.

i have added this following script to the head of the document
<script type="text/javascript">
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
</script>
In the Body i have:
                echo    "<table width='900' border='2'>
                <tr>
                <td align='left' width='163' height='122' rowspan='4'>
                <div id='picture' style='padding:0px; margin:0px;'>
                        <img src='img/" . $Registration . "/01.jpg' width='163' height='122'/>
                </div>
            </td>
                <td align='center' height='30.5' width='574' colspan='4'>
                <div id='title'><a href='#' onclick="MM_openBrWindow('vehicle.php','Vehicle Test','scrollbars=yes,width=700,height=610')">".$Title."</a></div>
            </td>
from this code what i understand is that the " in the onclick, it is cancelling with the " before the table tag.

and if i change that to a ', it ends up clashing with the ' before the vehicle example:
<div id='title'><a href='#' onclick='MM_openBrWindow('vehicle.php','Vehicle Test','scrollbars=yes,width=700,height=610')'>".$Title."</a></div
Problem - when i click on this link, i get the # in the url but no pop up is opened

what is the best way around this problem?

Re: Pop Up

Posted: Fri May 20, 2011 3:24 am
by Tino
You mean like one of those pop-ups you get similar to the ones you get when you try to refresh a page with a submitted form?

For that you could use alert, I suppose...
alert('hello');

Re: Pop Up

Posted: Fri May 20, 2011 9:47 am
by toqi786
no, it will be a new window that will have code in it!