FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

javascript help. creating new element only when clicked

 


Mgccl
Here is what I'm using

prototype window class

http://prototype-window.xilinus.com/

Code:
<a onClick = "profile('1')">test</a>

<script type="text/javascript">
function profile($id) {
var $url = "profile.php?id=" + $id;
win = new Window($id, {title: "Sample", width:200, height:150, url:$url});
win.setDestroyOnClose();
win.showCenter();
}
</script>

after I clicked... what I found is it says a window is already exsisted in the DOM.
my inspection is, while the 'win' object is in the function, it is already created.
or maybe not... but I would not know why.. but.. to test my thinking, I need a new way to write the code. anyone got ideas?
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.