Obviously, there was some kind of misunderstanding, but anyway, the problem is solved.
Have programming fun!
:
This message was edited by the Thummy at 2002-6-19 8:17:24
: I'll correct you (like you asked for "if you were wrong"): It is very possible (to do what you THINK I wanna do: Including a file based on "whatever"). I already do it all the time! But: If I include a nested file (based on a cookie or something else) I can do all things, except that a document.write() gives his output AFTER the closing of my initial file's <script> tag, not at the place the nested file is included. (I agree, a minor problem, but I'm looking for a fix for THAT)
:
: Still very thnx for replying, in the process of making myself clear (rephrasing the problem over and over) I now think I know the answer to my own question...lol..

: Greetz Thummy
: : Yes, I did, and what you wanted to do is not possible as far as I know (but if I'm wrong, please correct me).
: : I just gave a possible solution for your problem in the example, which was, that you wanted to include a file based on the value of the cookie.
: :
: : :
This message was edited by the Thummy at 2002-6-19 5:28:6
: : : Hi CompuChip, so your dutch too (das makkelijk, maar ik ga toch maar door in t engels)
: : : I dont see what your reply has to do with my question? (what is not possible?)
: : : It's not about "who can do what" or how to show things optionally, nor about programm flow conditions. It's about nesting scripts and the way browsers render their output...
: : :
: : : Dit you look at my Example?
: : :
: : : Greetz Thummy
: : :
: : :
: : :
: : :
: : : : Don't think it's possible. I think the best solution would be creating a global variable like
: : : :
: : : : var cookieIsTrue;
: : : : cookieIsTrue = (loginname == "Administrator");
: : : :
: : : : and then make the functions like this
: : : :
: : : : function weergeef_menu() {
: : : : if (cookieIsTrue) {
: : : : document.write("Hallo, Administrator. Welke gebruiker wilt u verwijderen?");
: : : : // Some more
: : : : }
: : : : else {
: : : : document.write("Hallo. U mag geen gebruikers wijzigen");
: : : : }
: : : : }
: : : :
: : : : :
This message was edited by the Thummy at 2002-6-11 12:42:10
: : : : : OK more details...
: : : : :
: : : : : I've got a site with lots of extra functionalities.
: : : : : These are in different scripts and all together a bit big.
: : : : :
: : : : : In my HTML I just include one scriptfile (<script src='http://....'></script>)
: : : : : That:
: : : : : - Generates a (hideable) form where a visitor can set options that are stored in a cookie.
: : : : : - Reads the cookie at next visit, or a reload, and then I refer more files by doing things like:
: : : : : if(some_cookie_value){
: : : : : document.write("<script src='http://....'></script>");
: : : : : }else{
: : : : : document.write("<script src='http://....'></script>");
: : : : : }
: : : : :
: : : : : All functions can be called, but a "inline" document.write() now "gives his result" a lot lower in the page then it should. In my IE beneath the table the cell is in that "holds" my script. In IE on a Mac it appears at the total bottom of the page???
: : : : :
: : : : : Netscape 4.7 does it all right!!!.
: : : : : I'm getting to think by now it's an IE bug, I can't change that, so the initial question still stands, does someone knows another way to archive the include effect I need?
: : : : : I made a test/proof, very minimal, only contains the "bug", go
http://www.xs4all.nl/~thummy/nested/nested.html for a view.
: : : : :
: : : : :
: : : : :
: : : : :
: : : : :
: : : :
: : : :
: : :
: : :
: : :
: : :
: : :
: : :
: : :
: : :
: :
: :
:
:
:
:
:
: