[HTML_AJAX-devel] important changes for beta
Jan Pilarzeck
jan at motubo.com
Mon Jul 24 01:02:29 PDT 2006
Hello,
i need to change the way i include the JS-client into pages. Instead of
something like
<script type='text/javascript'
src='ajaxServer.php?client=all&stub=abc'></script>
i need a method that outputs the JS delivered by the URL in the line above. EG:
<script type='text/javascript'><?php echo $server->generateClient();
?></script>
But this don't works, because:
- it does not return the JS, but it outputs it directly -> what if i need the
output elsewhere than the call itself is located?
- it requires some other methods called before and parameters in the
superglobal $_GET. And those parameters can't be delivered as a parameter in
the method call
Let me describe what i want to do:
I have got 2 files - main.php and ajaxServer.php - i think its clear what they
should do...and both use the same "core", which inits the session, gets all
requirements and also does the user authentication, DB-connection etc.
If someone hits main.php, 2 requests are sent out and all the above described
actions are done twice. So i rather want to output the JS directly in the page
than including it from another URL. So, if the "core" takes 0.5 seconds, it
takes at least 1 second to load the page and its JS complete.
But, its not only a performance issue: We use session_regenerate_id() ("session fixation") in our session management and this runs into a "race condition" with the above mentoined behaviour.
Another thing i would like to change: all parameters (those of my application)
are automatically added to URLs retrieved by HTML_AJAX_Server::$serverUrl. It should be
possible to turn this of if this is not required.
Especially point 1 - the direct output of the client-JS is very important to
me. So, do you have any hints for me to built in a workaround until you built
in (i hope) that functionality? I tried it with output buffer...but you use already within HML_AJAX and have no other ideas...
May i support you with some coding?
Thanks in advance, Jan
More information about the Html_ajax-devel
mailing list