JavaScript JQuery inside here-doc not working

Is it possible to include JQuery in the here-doc section of perl. I tried but no success. Here is my code.

my $cgi = CGI->new();print header();print start_html("JQuery in perl");

print <<JS;
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script><!--
$(document).ready(function(){
$("p").click(function(){
$(this).hide();
 });
});
//--></script>

<p>Click to hide</p>
<p>Click to hide</p>
<p>Click to hide</p>
</body>
JS
print end_html();

But when I write a javascript function, it works fine

my $cgi = CGI->new();print header();print start_html("hello");
print <<JS;
<script><!--
function show() {alert("Hello");}
//--></script>
<input type="button" value="Check"  onclick="show()">
</body>
JS
print end_html();

Am I missing something obvious here ?Please suggest.

Answer:1

This is a basic html/javascript code, but I am having issues getting the sum of all fields. (The are 50 fields in the original project, but now I just leave 5) If the field is blank, it just has to ...

This is a basic html/javascript code, but I am having issues getting the sum of all fields. (The are 50 fields in the original project, but now I just leave 5) If the field is blank, it just has to ...

  1. issue fields in jira
  2. issue.fields
  3. http://issue.fields.issuetype.name
  4. issue.fields jira python
  5. issue.fields.customfield
  6. issue.fields.issue links
  7. issue.fields.summary
  8. issue.fields.assignee
  9. issue.fields.status
  10. issue.fields.description
  11. issue fields jira api
  12. issue.fields.worklog.worklogs
  13. issue.fields.issuetype
  14. issue.fields.components
  15. issue.fields.comment
  16. issue.fields.priority
  17. issue.fields.labels
  18. issue.fields.customfield python
  19. issue.fields.project.key
  20. issue.fields.time tracking

This is the code when i am adding in all textbox it works fine but after removing number it shows NaN function sumVal() { var total = 0; var coll = document.getElementsByTagName("input") ...

This is the code when i am adding in all textbox it works fine but after removing number it shows NaN function sumVal() { var total = 0; var coll = document.getElementsByTagName("input") ...

I already tried to swap the functions on owl.carousel.js but it only works when the mouse moves. var Autoplay = function(scope) { this.core = scope; this.core.options = $.extend({}, Autoplay.Defaults,...

I already tried to swap the functions on owl.carousel.js but it only works when the mouse moves. var Autoplay = function(scope) { this.core = scope; this.core.options = $.extend({}, Autoplay.Defaults,...

  1. carousel candies
  2. carousel candle
  3. carousel candyland
  4. carousel candies monterey
  5. carousel candy dispenser
  6. carousel candle holder
  7. carousel candle topper
  8. carousel candy bags
  9. carousel candy machine
  10. carousel candle set
  11. carousel candy apples
  12. carousel candy store
  13. carousel candyland kahala
  14. carousel candy table
  15. carousel candyland popcorn
  16. carousel candy monterey ca
  17. carousel cannington
  18. carousel candy dish
  19. carousel canalside buffalo
  20. carousel candies geneva

I have the following Javascript code which should rapidly switch between two images: <head runat="server"> <title>Home Page</title> <script src="Resources/jQuery.js" ...

I have the following Javascript code which should rapidly switch between two images: <head runat="server"> <title>Home Page</title> <script src="Resources/jQuery.js" ...

  1. javascript switching between tabs