CodeIgniter Forums

Full Version: help? js
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Captain_Fluffy_Pants[/eluser]
For some reason my javascript isnt working?
Code:
<html>
<head>
<title><?php echo $title;?></title>
<meta name="viewport" content="width=device-width" />
<!--CSS-->
<link href="//moar.lulzlab.com/css/bootstrap.css" rel="stylesheet" />
<!--JS-->
<sript type="text/javascript" src="//moar.lulzlab.com/js/bootstrap.js"></sript>
<sript type="text/javascript" src="//moar.lulzlab.com/js/jquery.js"></sript>
<sript type="text/javascript" src="//moar.lulzlab.com/js/scripts.js"></sript>
&lt;!--Google Analytic's--&gt;
<sript type="text/javasript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-34350337-1']);
  _gaq.push(['_setDomainName', 'lulzlab.com']);
  _gaq.push(['_setAllowLinker', true]);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s[removed].insertBefore(ga, s);
  })();

</sript>
&lt;/head&gt;
do any of you know why?
by the way i put "sripts" instead of "scripts" because if you put that for some reason it says "removed"

El Forum

[eluser]PhilTem[/eluser]
What's not working about your JS? Do you see any error printed out?

BTW: Is it a typo or why do you have
Code:
src="//..."
without a leading http:?

El Forum

[eluser]solid9[/eluser]
Remove "sript" and put back "script"

That's funny.

El Forum

[eluser]PhilTem[/eluser]
[quote author="Captain_Fluffy_Pants" date="1348348953"][...]
by the way i put "sripts" instead of "scripts" because if you put that for some reason it says "removed"[/quote]

The OP changed scripts to sripts so it won't be removed by this forum's sanitizer Wink

El Forum

[eluser]jmadsen[/eluser]
1) "//..." is a common way to allow the resource to be either https or http, and works just fine

2) you have your jquery as the second resource, but I believe your bootstrap.js depends on it being loaded

3) please don't post code and say it's "not working" with nothing else. The is a programmers' forum - talk like a programmer
http://www.chiark.greenend.org.uk/~sgtatham/bugs.html