Forum Moderators: open

Message Too Old, No Replies

Bootstrap blocks write?

         

toplisek

2:15 pm on Oct 26, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I have tried to insert elements like:
<script type="text/javascript"> document.write(XXX); </script>
It will be an error as it is not detected. How to avoid this inside bootstrap as without it will work.

robzilla

4:21 pm on Oct 26, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



* hesitates before going down another rabbit hole [webmasterworld.com] *

I believe Bootstrap employs jQuery, but neither blocks native Javascript calls like document.write(). What's the error you get?

It's generally better to use DOM manipulation [api.jquery.com] than document.write().

toplisek

11:50 am on Oct 27, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I have to test output and will post you an error.

birdbrain

12:13 pm on Oct 27, 2018 (gmt 0)



Hi there toplisek,


this code...



document.write(XXX);



..will give this information...

ReferenceError: XXX is not defined

Your either need to use this...



document.write( 'XXX' );
document.close();



...or this...



var XXX = 'Hello World';

document.write( XXX );
document.close();



Better still don't use...



document.write();



...at all. :)



birdbrain

toplisek

10:38 am on Oct 28, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I have tested and seen the following error:
ReferenceError: xxx is not defined
Source: [developer.mozilla.org...]
When I add document.close(); it will not work inside Bootstrap as without this it will work.

It seems script should be completely rewritten.

birdbrain

11:03 am on Oct 28, 2018 (gmt 0)



Whatever.

robzilla

3:39 pm on Oct 28, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



So, exactly what birdbrain said. Are you not reading replies?

keyplyr

2:22 am on Oct 29, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



hesitates before going down another rabbit hole
A caution I need to hone :)

toplisek

9:55 pm on Nov 1, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The script will be completely rewritten as it will be added new features. Thank you for your help.

birdbrain

10:29 pm on Nov 1, 2018 (gmt 0)



Hi there toplisk.
reading your posts, always takes me back, with deep joy, to Professor Stanley Unwin
and his splendid way of explaining the many thingies...

Maximole Satisfactual & Deep Joy [youtube.com]



birdbrain

toplisek

8:30 pm on Nov 2, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Any words said in Love should be listen. Thank you.