Blank page when jQuery is turned on

I am trying to add jQuery to my PHP script. Everything is going well except for adding a jQuery script. Then the page is blank.

Here is my code:

function site_header() { echo "<html dir=\"rtl\"> <!DOCTYPE HTML> <html> <head> <meta name=\"viewport\" content=\"width=device-width; initial- scale=1.0; maximum-scale=1.0;\"> <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"> <title>Arabsfun :: تسالي العرب</title> <link href=\"css/style.css\" type=\"text/css\" rel=\"stylesheet\">"; echo Pulse::css(); echo Pulse::javascript(); echo "</head> <body> <div id=\"wrap\"> <div class=\"header\"> <div class=\"logo\"> <a href=\"index.php\"><img src=\"images/logo.png\" alt=\"Arabsfun\" /></a> </div> <div class=\"clear-float\"> </div><br> </div> <div class=\"content\">" . navbar() ." </div> </center>" ; } 

Then I use the site_header() function to launch the title on the page.

Any idea on how to solve this problem?

+4
source share
4 answers

I do not see jQuery references in this code at all. I'm going to assume that you typed something like:

 <link href=\"css/style.css\" type=\"text/css\" rel=\"stylesheet\"> <script type=\"text/javascript\" src=\"jquery.js\"> 

You need to close </script> , otherwise the whole page will be considered a script and nothing will be released.

+4
source

I also came across this. The answer for me was to use a script tag, and not end it with a slash in a single tag. IE did not take it.

This is what I had that didn't work ...

 <script type="text/javascript" src="#variables.jQueryURL#" /> 

This is what I replaced with this ...

 <script type="text/javascript" src="#variables.jQueryURL#"></script> 

(There's a ColdFusion variable there, but that doesn't matter for this problem.)

+3
source

Put it just like html and enable it. You did nothing, which requires a server-side script (for the header).

0
source

While editing the code, I noticed unequal tags. The <body> not closed, and there may be others.

0
source

Source: https://habr.com/ru/post/1395435/


All Articles