Welcome to WebmasterWorld Guest from 3.92.28.84

Forum Moderators: open

Message Too Old, No Replies

Bootstrap blocks write?

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

Senior Member

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

joined:Oct 25, 2006
posts: 1103
votes: 1


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.
4:21 pm on Oct 26, 2018 (gmt 0)

Senior Member

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

joined:Sept 25, 2005
posts:2091
votes: 370


* 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().
11:50 am on Oct 27, 2018 (gmt 0)

Senior Member

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

joined:Oct 25, 2006
posts: 1103
votes: 1


I have to test output and will post you an error.
12:13 pm on Oct 27, 2018 (gmt 0)

Senior Member from GB 

joined:Oct 2, 2003
posts: 1019
votes: 39


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
10:38 am on Oct 28, 2018 (gmt 0)

Senior Member

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

joined:Oct 25, 2006
posts: 1103
votes: 1


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.
11:03 am on Oct 28, 2018 (gmt 0)

Senior Member from GB 

joined:Oct 2, 2003
posts: 1019
votes: 39


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

Senior Member

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

joined:Sept 25, 2005
posts:2091
votes: 370


So, exactly what birdbrain said. Are you not reading replies?
2:22 am on Oct 29, 2018 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member keyplyr is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Sept 26, 2001
posts:12913
votes: 893


hesitates before going down another rabbit hole
A caution I need to hone :)
9:55 pm on Nov 1, 2018 (gmt 0)

Senior Member

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

joined:Oct 25, 2006
posts: 1103
votes: 1


The script will be completely rewritten as it will be added new features. Thank you for your help.
10:29 pm on Nov 1, 2018 (gmt 0)

Senior Member from GB 

joined:Oct 2, 2003
posts: 1019
votes: 39


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
8:30 pm on Nov 2, 2018 (gmt 0)

Senior Member

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

joined:Oct 25, 2006
posts: 1103
votes: 1


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