Jones_Rob
02-10-2011, 01:32 PM
Hi,
I'm a novice with javascript though I've hacked scripts before to satisfy my own requirements - however this is too tricky for me to work out alone. Any help or guidance to solving this is very much appreciated.
So I'm looking to throw up a popup lightbox on my page after a few seconds delay. The code I have is:
<script type='text/javascript' src='jquery.js'></script>
<script type='text/javascript' src='lightbox.js'></script>
<script type="text/javascript">
var popup_domination = {"defaults":{"Name":"Your First Name...","Email1":"Your Email Address..."},"delay":2,"cookie_time":1,"center":"Y","cookie_path":"\/","show_opt":"open","unload_msg":"Would you like to signup to the newsletter before you go?","impression_count":0,"output":"<div class=\"popup-dom-lightbox-wrapper\" id=\"popup_domination_lightbox_wrapper\" style=\"display:none\">my content goes in here<\/div>"};
</script>
You'll notice the content is inline, but what I'd like to do is use an external HTML file - it saves me having to escape all the HTML within the javascript y'see...
I'm guessing the "output":"<div class=\"popup-dom-lightbox-wrapper\" id=\"popup_domination_lightbox_wrapper\" style=\"display:none\">my content goes in here<\/div>" is what I need to change - but how could I load and external HTML file in here instead?
Many thanks,
Rob.
I'm a novice with javascript though I've hacked scripts before to satisfy my own requirements - however this is too tricky for me to work out alone. Any help or guidance to solving this is very much appreciated.
So I'm looking to throw up a popup lightbox on my page after a few seconds delay. The code I have is:
<script type='text/javascript' src='jquery.js'></script>
<script type='text/javascript' src='lightbox.js'></script>
<script type="text/javascript">
var popup_domination = {"defaults":{"Name":"Your First Name...","Email1":"Your Email Address..."},"delay":2,"cookie_time":1,"center":"Y","cookie_path":"\/","show_opt":"open","unload_msg":"Would you like to signup to the newsletter before you go?","impression_count":0,"output":"<div class=\"popup-dom-lightbox-wrapper\" id=\"popup_domination_lightbox_wrapper\" style=\"display:none\">my content goes in here<\/div>"};
</script>
You'll notice the content is inline, but what I'd like to do is use an external HTML file - it saves me having to escape all the HTML within the javascript y'see...
I'm guessing the "output":"<div class=\"popup-dom-lightbox-wrapper\" id=\"popup_domination_lightbox_wrapper\" style=\"display:none\">my content goes in here<\/div>" is what I need to change - but how could I load and external HTML file in here instead?
Many thanks,
Rob.