Welcome, Guest
Username: Password: Remember me

TOPIC: In what file do I find the noscript message: "Caution: JavaScript execution is d

In what file do I find the noscript message: "Caution: JavaScript execution is d 1 year 5 months ago #95704

  • Sweden
  • Sweden's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 64
  • Thank you received: 1
  • Karma: 2
Hi,

In what file do I find the noscript message: "Caution:JavaScript execution is disabled in your browser. You may not be able to answer all questions in this survey. Please, verify your browser parameters."?

I want to add
<noscript>
    #container {display:none;}
</noscript>
so that nothing is shown (except the message above) in the event that JavaScript has been disabled. I tried to insert the code directly in the survey's description source field but that didn't work...
Last Edit: 1 year 5 months ago by Sweden.
The administrator has disabled public write access.

In what file do I find the noscript message: "Caution: JavaScript execution is d 1 year 5 months ago #95707

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6471
  • Thank you received: 854
  • Karma: 254
Hello,

Best solution : hide it foe all in CSS, show it in javascript.
  1. Copy the template
  2. Add this in your css : #limesurvey{display:none}
  3. Add this in your template.js (after $(document).ready(function(){): $("#limesurvey").show('slow');
  4. Add this in your startpage.pstpl (after body start): {CHECKJAVASCRIPT}
And give it a try with/without javascript
Last Edit: 1 year 5 months ago by DenisChenu.
The administrator has disabled public write access.
The following user(s) said Thank You: Sweden

In what file do I find the noscript message: "Caution: JavaScript execution is d 1 year 5 months ago #95729

  • Sweden
  • Sweden's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 64
  • Thank you received: 1
  • Karma: 2
Thanks Denis :)

It works now but I had to add the "#limesurvey{display:none}" to my template.css file (perhaps that was what you meant?) I tried to add it to the description source field but that didn't work...

Should I also add that line to ie_fix_6.css, ie_fix_7.css, ie_fix_8.css and perhaps also the other css files (I'm not sure what they do)?

I'm curious - do you know why I can't just use the noscript tag?
The administrator has disabled public write access.

In what file do I find the noscript message: "Caution: JavaScript execution is d 1 year 5 months ago #95730

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6471
  • Thank you received: 854
  • Karma: 254
Because css can be added only inline (<div style="display:none" />) or between head /head.

No, just in template.css, other fix base css for ie.

www.w3.org/Style/CSS/
The administrator has disabled public write access.

In what file do I find the noscript message: "Caution: JavaScript execution is d 1 year 5 months ago #95732

  • Ben_V
  • Ben_V's Avatar
  • OFFLINE
  • Platinum Lime
  • Posts: 1125
  • Thank you received: 259
  • Karma: 79
Because css can be added only inline (<div style="display:none" />) or between head /head

Yes...! BTW the following js way may sometimes become very interessant to add some css rules directly almost everywhere in a survey without the need ofediting the template (especially if the template is shared by several surveys)
<script type="text/javascript">
	$(document).ready(function(){
		$( "<style type='text/css'>"
		+"#limesurvey { display:none }"
		+"</style>").appendTo( "head" );
	});
</script>
Benoît

goo.gl/Bw5iM => Recherche GG dans le forum français (remplacer "exemple" dans la barre de recherche)
goo.gl/WX8PH => GG search for english forum (Replace "example" in the search bar)
goo.gl/IxiGu => Búsqueda en el foro en español (Cambiar "ejemplo" en la barra de...
The administrator has disabled public write access.

In what file do I find the noscript message: "Caution: JavaScript execution is d 1 year 5 months ago #95735

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6471
  • Thank you received: 854
  • Karma: 254
You're totally right except for:

better is to use jquery ( $("#limesurvey").css('display','none');)
And using it this way: the survey is shown without js but hide in js (noscript ;) ).

Denis
The administrator has disabled public write access.

In what file do I find the noscript message: "Caution: JavaScript execution is d 1 year 5 months ago #95736

  • Sweden
  • Sweden's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 64
  • Thank you received: 1
  • Karma: 2
DenisChenu wrote:
Because css can be added only inline (<div style="display:none" />) or between head /head.

Thanks again, I thought that I could just wrap it in <style></style> tags but I'm not good at this :side:

Your method is fine but now I'm curious to know why the "noscript" way can't be added to some file instead. Hope someone knows this because I like to learn from every problem I bump into.
The administrator has disabled public write access.

In what file do I find the noscript message: "Caution: JavaScript execution is d 1 year 5 months ago #95742

  • Ben_V
  • Ben_V's Avatar
  • OFFLINE
  • Platinum Lime
  • Posts: 1125
  • Thank you received: 259
  • Karma: 79
Sweden,
...why the "noscript" way can't be added
Good question but no idea... ( maybe because LS already includes a JS availability detection )
because I like to learn from every problem I bump into.
The best way to go further and get solid knowledge !


Denis,
Yes it's true... The only advantage of the code I provided, is allowing the extra use of media specification (as you already know: can be very useful ;) )
$( "<style type='text/css' media='screen and (min-width:481px)'>"
+"li { display:inline }"

Tip for beginners: Note the now necesary white-spaces after/before the use of curly braces. If absent the code will be interpreted by LS (versions ≥1.92) as a declared {KEYWORDS} , {QUESTIONCODES}, etc.
So if you want to add some css rules in the startpage.pstpl, you have to apply this syntax as well:
<style>
#limesurvey { display:none } /* Correct */
#limesurvey {display:none} /* Wrong */
</style>
Benoît

goo.gl/Bw5iM => Recherche GG dans le forum français (remplacer "exemple" dans la barre de recherche)
goo.gl/WX8PH => GG search for english forum (Replace "example" in the search bar)
goo.gl/IxiGu => Búsqueda en el foro en español (Cambiar "ejemplo" en la barra de...
Last Edit: 1 year 5 months ago by Ben_V.
The administrator has disabled public write access.
The following user(s) said Thank You: Sweden

In what file do I find the noscript message: "Caution: JavaScript execution is d 1 year 5 months ago #95777

  • Sweden
  • Sweden's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 64
  • Thank you received: 1
  • Karma: 2
Ben_V wrote:
Tip for beginners: Note the now necesary white-spaces after/before the use of curly braces. If absent the code will be interpreted by LS (versions ≥1.92) as a declared {KEYWORDS} , {QUESTIONCODES}, etc.
So if you want to add some css rules in the startpage.pstpl, you have to apply this syntax as well:
<style>
#limesurvey { display:none } /* Correct */
#limesurvey {display:none} /* Wrong */
</style>

Thanks Ben, I didn't know that but now I know ;)
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.173 seconds
Donation Image