Forum moderator: bigblog |
uCoz Community For Webmasters Custom Solutions 2 Automatic AJAX window on webpage load (Tutorial) |
2 Automatic AJAX window on webpage load |
I wrote the following codes where customised by myself. However their sources belong to their rightful owners, DO NOT claim them as your own work. Both scripts have been tested and work.
1. Automatic AJAX window in center of page Place the following script between the header tags. Code <script type="text/javascript"> window.onload = function ajaxauto(){ var ajax_data = 'content goes here'; new _uWnd('myname','title',300,350,{shadow:1,autosize:1,modal:0,close:1},ajax_data);} </script> 2. Automatic AJAX window in bottom right of your page Place the following script between the header tags. Code <script type="text/javascript"> window.onload = function ajaxbtm() {_uWnd.alert('Content goes here','Title',{w:500,h:100,tm:10000});} </script> 'Content goes here' - The content 'Title' - The title 300,350 / w:500,h:100 - The size measured in pixels (px) tm:10000 - Duration before window closes More info - http://forum.ucoz.com/forum/36-8296-43813-16-1255606466 |
#1. I've edited the thread, the second AJAX window is the only one available for a time before it closes.
#2. In the content area place the following: Code Make sure to <a href="$REGISTER_LINK$">Regsiter</a> or <a href="$LOGIN_LINK$">Login</a> Kind regards,
Elliott. "The best uCoz" critic since 2007. Qualified website, branding, print & user interface designer. I'm on Behance and Twitter. Post edited by CreativeCollusions - Sunday, 2011-01-02, 1:40 PM
|
CreativeCollusions, I am having a problem. I have set a page to personal template, than put your code in my header. Yield no results however, I am not sure what thelittle thing I am missing is however I know it must be silly.
You see my code: Code <script type="text/javascript"> window.onload = function ajax(){ var ajax_data = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH=500 HEIGHT=281> <PARAM NAME=movie VALUE="/flashobjects/fa.swf"> <PARAM NAME=menu VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM NAME=wmode VALUE=opaque> <PARAM NAME=scale VALUE=noscale> <EMBED src=/flashobjects/fa.swf menu=false quality=high wmode=opaque scale=noscale WIDTH=500 HEIGHT=281 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"> </EMBED> </OBJECT>'; new _uWnd('myname','Join our Community!',500,281,{shadow:1,autosize:1,modal:0,close:1},ajax_data);} </script> and than, to test my theories I simply copied your alert window code to my header and yielded no results.
Code <script type="text/javascript"> window.onload = function ajax-bottom() {_uWnd.alert('Content goes here','Title',{w:500,h:100,tm:1000});} </script> I hope you can help me understand where my fault is! |
FuriousAngels, please provide the link to your website.
Goblok, |
CreativeCollusions,
Sorry for the delay, hate to have you post another message since your at such a unique number as it is. I will be private messaging you in hopes to hear from you sooner. Thanks! |
FuriousAngels,
Quote (FuriousAngels) and than, to test my theories I simply copied your alert window code to my header and yielded no results.
Code <script type="text/javascript"> window.onload = function ajax-bottom() {_uWnd.alert('Content goes here','Title',{w:500,h:100,tm:1000});} </script> I hope you can help me understand where my fault is! I tried that code and I managed to get the function called if you change ajax-bottom to something else, try testfunct which stands for test function. That did the trick for me. "Friends don't let friends use Internet Explorer 6." - Microsoft || Join the cause. Help your friends.
|
FuriousAngels, not a problem. Since your using a personal template you may have to add the jQuery and CSS files manually. It's very simple. Make a backup copy of your website template first, just in case you make a mistake.
Place the script below between your head tags, and then the script you want (provided in the main thread), also in between the head tags. Code <link type="text/css" rel="StyleSheet" href="http://s29.ucoz.net/src/layer1.css" /><script type="text/javascript" src="http://s29.ucoz.net/src/u.js"></script> |
CreativeCollusions, I forgot to mention this didnt work
Added (2011-01-17, 0:15 Am) |
Blazer, from what I know you can place either code anywhere on your page as long as any of the code is within the script tags.
Hope this helps Jack of all trades in development, design, strategy.
Working as a Support Engineer. Been here for 13 years and counting. |
| |||