duncan_cowan Posted March 8, 2007 Share Posted March 8, 2007 hi i have used "prototype window" to have a popup window in my site but i do not know why it is not working:(main popup script in middle) <html><head><script type="text/javascript" src="/protected/prototype_win/javascripts/prototype.js"> </script><script type="text/javascript" src="/protected/prototype_win/javascripts/window.js"> </script> <link href="/protected/prototype_win/stylesheets/themes/default.css" rel="stylesheet" type="text/css"/></head> <tr> <td colspan="3" height="85" background="protected/images/WW6_16.gif" <--Main Popup Section-->onclick="window.location.href='var win = new Window({className: 'spread', title: 'Ruby on Rails',top:70, left:100, width:300, height:200,url: 'http://www.rubyonrails.org/', showEffectOptions: {duration:1.5}}); java script:win.show()'" style="cursor: pointer"><--end popup section--><div align="center"><p>Click Here To Enter Protected Area </div></td> </body></html> it does contain more script obviously but i think these are the only important parts.please could someone help?thanks Link to comment Share on other sites More sharing options...
Lepper Posted March 8, 2007 Share Posted March 8, 2007 it's absolutely necesary that all that "onclick" code be on the same line? I think that maybe is a quote problem (or that "java script" sentence maybe have to be "javascript") Link to comment Share on other sites More sharing options...
duncan_cowan Posted March 8, 2007 Author Share Posted March 8, 2007 i have done this and now it displays the page in a box at the top of my page but it is embedded into the page not like a popup Link to comment Share on other sites More sharing options...
Lepper Posted March 8, 2007 Share Posted March 8, 2007 i have done this and now it displays the page in a box at the top of my page but it is embedded into the page not like a popupmaybe this works:...onclick="window.open(window.location.href='var win = new Window({className: 'spread', title: 'Ruby on Rails',top:70, left:100, width:300, height:200,url: 'http://www.rubyonrails.org/', showEffectOptions: {duration:1.5}}); java script:win.show()')" style="cursor: pointer">... I'm not sure if this will work... but you can try :)Note: I think that there is a "}" that has no start "{"You must delete the last "}" Link to comment Share on other sites More sharing options...
jesh Posted March 8, 2007 Share Posted March 8, 2007 I've never used prototype, so I don't know if this is the problem, but it looks like it could be. You're attempting to redirect the page (location.href) to a couple of lines of javascript rather than an actual URL.Rather than: onclick="window.location.href='var win = new Window({className: 'spread', title: 'Ruby on Rails', top:70, left:100, width:300, height:200, url: 'http://www.rubyonrails.org/', showEffectOptions: {duration:1.5}}); java script:win.show()'" You might try: onclick="var win = new Window({className: 'spread', title: 'Ruby on Rails', top:70, left:100, width:300, height:200, url: 'http://www.rubyonrails.org/', showEffectOptions: {duration:1.5}}); win.show();" Link to comment Share on other sites More sharing options...
duncan_cowan Posted March 8, 2007 Author Share Posted March 8, 2007 no have tried these but the frame still displays within the pagethe prototype window is here Link to comment Share on other sites More sharing options...
jesh Posted March 8, 2007 Share Posted March 8, 2007 no have tried these but the frame still displays within the pagethe prototype window is here Well, I can tell you that setting the location.href to a reference to a window (as opposed to a URL) will never work so I suggest ditching that piece of code. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now