scriptprintparentsolutiondocument

A softwarerating -directory

Demo search...   

Menu


Play me


Play!

Nice software sites


Settings

Font [] :  
Gamma : Light
Language : Russian

My link

text link:


button:


... / Forum / Web development / Ajax :

Is AJAX - necessary?





Wolf [ Admin | Message: 31 | Registered: 28 November 2006 | Website | E-mail ]
On Saturday, 6 January 2007 [10:56]
Left message

I found a substitute in "zero" frame use. Instead "http...request", I use:

Код
<iframe name="null" id="null" width="0" height="0" style="visibility: hidden; position:absolute; left:-200px"></iframe>

and loads scripts into - with:

Код
<a href="script.php" target="null">AJAX it</a>
<form action="script.php" target="null" method="post">

Then PHP-script returns values in parent window by:

Код
print 'top.document.getElementById("id").innerHTML="new value";';
print 'window.parent["js_var"]="new val";';
//etc

Most nasty thing in this "technology", that after script' execution remains traces in browser' history, so when you go to previous page by backspace - script executes again. Solution is to replace "ajax" page at the end of PHP-script:

Код
print 'document.location.replace("/ajax.php");';
//where ajax.php - any ampty file - i.e. fake

so in history will be left "ajax.php" instead "script.php".





Wolf [ Admin | Message: 31 | Registered: 28 November 2006 | Website | E-mail ]
On Saturday, 6 January 2007 [10:59]
Left message

P.S.. Solution with fake was given in Russian programmer' forum: http://www.forum.vingrad.ru/ by Sardar.



Nickname:
Password:
E-mail:  Get the password
ICQ:
Website [URL]:
Signature: [300]
Subscribe:
Advice: If you already registered - nickname + password will be enough to identify you

Message: [5000]

Citation Super-Citation Code Shady text :) :( ;) :D =) =( :o =o 8)) 8(




Wolf's Ware 2004-2008 © Wolf