Note that there are some explanatory texts on larger screens.

plurals
  1. POFirefox and IE aren't displaying "<script ... > ... </script>" provided from PHP
    primarykey
    data
    text
    <p>Hey everyone, I am having a problem with a website I'm trying to build; basically I have a class that I call from my header file that loads all of the link and script tags. The link tags show up across all browsers, but the script tags only show up in safari and chrome, they do no show up in firefox or IE.</p> <pre><code>&lt;script type='text/javascript' src='...'&gt; </code></pre> <p>now I have tried removing the "&lt;" at the front of the tag just to see what happens, and it will show up as plain text then, but as soon as I put the "&lt;" back it is again MIA.</p> <p>So here is what's going on in the php. My <b>header.php</b> file calls the cms object function, located in <b>cms.php</b>, and those functions call other functions in my <b>system.php</b> file. </p> <p>Now, again the link tags work w/out a hitch and I call them the exact same way ... it is just the dumb script tags. When I call the load_js("config"); function in my header.php it will load multiple tags as well. If it was just 1 tag I would put the script tags in the html rather than in the php, but I don't think I can do that when I'm producing multiple tags.</p> <p>Any help would be great! Thanks in advance as well!</p> <h2>header.php</h2> <pre><code>&lt;?php echo $this-&gt;load_css("config"); ?&gt; &lt;?php echo $this-&gt;load_js("config"); ?&gt; </code></pre> <h2>cms.php</h2> <pre><code>function load_js($name){ // ... return header_script($name.".js"); // ... } function load_css($name){ // ... return header_link($name.".css"); // ... } </code></pre> <h2>system.php</h2> <pre><code>function header_script(){ // 0 = src $num = func_num_args(); if($num == 0){ return;// if no arguments, can't successfully build header_script. } if($num == 1){ return "&lt;script type='application/javascript' src='".func_get_arg(0)."'&gt;&lt;/script&gt;\n"; } } function header_link(){ $num = func_num_args(); // 0 = rel // 1 = type // 2 = href if($num &lt; 3){ return; // can't successfully build link. } if($num == 3){ return "&lt;link rel='".func_get_arg(0)."' type ='".func_get_arg(1)."' href='".func_get_arg(2)."' /&gt;\n"; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload