Pop Up

JavaScript related questions should go here.
Post Reply
toqi786
Posts: 9
Joined: Mon May 16, 2011 12:43 pm

Pop Up

Post 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?
Tino
Posts: 360
Joined: Thu May 05, 2011 8:55 pm
Location: The Netherlands

Re: Pop Up

Post 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');
Please check out my CodeCanyon items.
toqi786
Posts: 9
Joined: Mon May 16, 2011 12:43 pm

Re: Pop Up

Post by toqi786 »

no, it will be a new window that will have code in it!
Post Reply