Personal computing discussed

Moderators: renee, SecretSquirrel, just brew it!

 
Elohim
Gerbil First Class
Topic Author
Posts: 153
Joined: Fri Jan 05, 2007 9:32 pm
Location: Wisconsin, United States of America

My javascript is functioning, but also showing on my page

Wed Dec 04, 2013 4:51 pm

Hi guys,

I just quick adding Google's custom search to my website per a request from a patron.

I got it working, but I cannot for the life of me figure out why my javascript is showing up as text on the page. It functions correctly, but is also showing. Normally text in a
<script>
tag would not show, right?

Check out my page: http://www.illuminatedink.com/search/

And the just do a view source and see if some of you can see something I am missing.

Thanks!
 
morphine
TR Staff
Posts: 11600
Joined: Fri Dec 27, 2002 8:51 pm
Location: Portugal (that's next to Spain)

Re: My javascript is functioning, but also showing on my pag

Wed Dec 04, 2013 5:24 pm

SCRIPT {display : inline}


That was on your CSS declaration. I have no clue why it is so :)
There is a fixed amount of intelligence on the planet, and the population keeps growing :(
 
Elohim
Gerbil First Class
Topic Author
Posts: 153
Joined: Fri Jan 05, 2007 9:32 pm
Location: Wisconsin, United States of America

Re: My javascript is functioning, but also showing on my pag

Wed Dec 04, 2013 5:42 pm

morphine wrote:
SCRIPT {display : inline}


That was on your CSS declaration. I have no clue why it is so :)


Hmm, not sure why that was there. I just now figured out how to hide it. I set visibility on the script element to hidden. Does not seem like I should have had to, but perhaps the display:inline thing broke the normally hidden part of scripts?

Anyway, thanks for looking. I got it now!
 
weaktoss
Gerbil
Posts: 65
Joined: Fri Jun 07, 2013 1:09 pm

Re: My javascript is functioning, but also showing on my pag

Wed Dec 04, 2013 5:55 pm

Does not seem like I should have had to, but perhaps the display:inline thing broke the normally hidden part of scripts?


That is correct. If you take the SCRIPT {display : inline} line out of your stylesheet, then you will not have to specify {visibility: hidden} on the script tag itself. It will be hidden by default.
 
morphine
TR Staff
Posts: 11600
Joined: Fri Dec 27, 2002 8:51 pm
Location: Portugal (that's next to Spain)

Re: My javascript is functioning, but also showing on my pag

Wed Dec 04, 2013 6:03 pm

<script> tags by default do not show. Apply no formatting whatsoever to them.

Do not try to fix what is not broken :)
There is a fixed amount of intelligence on the planet, and the population keeps growing :(

Who is online

Users browsing this forum: No registered users and 1 guest
GZIP: On