In Umbraco, inline javascript turned to lowercase in Chrome

Using Umbraco 7.2, when i try to write javascript inline (on the template page) When i view the page it breaks, using chrome dev tools i noticed it is converting all the javascript to lowercase so ".addClass" becomes ".addclass" and doesn't get recognised.
Strangely this only seems to happen in chrome, in firefox and IE it displays correctly.

I know using inline javascript is not best practice for Umbraco, but can anyone tell me why it might be doing this?

@inherits Umbraco.Web.Mvc.UmbracoTemplatePage @{ Layout = null; } <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>@ViewBag.Title - My ASP.NET Application</title> <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" /> <link rel="stylesheet" type="text/css" href="/css/style.css" /> <script src="js/libs/modernizr-2.0.6.min.js"></script> </head> <body> <header> <nav class="nav-menu"> <ul class="nav-menu-main"> <li><a href="/" class="nav-home glyphicon glyphicon-home"></a></li> <li> <a href="/">one</a><span></span> <ul class="nav-menu-sub"> @foreach (var item in CurrentPage.Site().adviserZone) { var linkUrl = (bool)item.isInternal ? Umbraco.NiceUrl(item.Value<int>("internal")) : item.link; var linkTarget = (bool)item.newWindow ? "_blank" : null; <li><a href="@linkUrl" target="@linkTarget">@item.caption</a></li> } </ul> </li> <li> <a href="/">two</a><!--<span class="caret"></span>--> <ul class="nav-menu-sub"> @foreach (var item in CurrentPage.Site().knowledgeCentre) { var linkUrl = (bool)item.isInternal ? Umbraco.NiceUrl(item.Value<int>("internal")) : item.link; var linkTarget = (bool)item.newWindow ? "_blank" : null; <li><a href="@linkUrl" target="@linkTarget">@item.caption</a></li> } </ul> </li> <li> <a href="/partners">three</a><span></span> <ul class="nav-menu-sub"> @foreach (var item in CurrentPage.Site().partners) { var linkUrl = (bool)item.isInternal ? Umbraco.NiceUrl(item.Value<int>("internal")) : item.link; var linkTarget = (bool)item.newWindow ? "_blank" : null; <li><a href="@linkUrl" target="@linkTarget">@item.caption</a></li> } </ul> </li> <li> <a href="/">four</a><span></span> <ul class="nav-menu-sub"> @foreach (var item in CurrentPage.Site().products) { var linkUrl = (bool)item.isInternal ? Umbraco.NiceUrl(item.Value<int>("internal")) : item.link; var linkTarget = (bool)item.newWindow ? "_blank" : null; <li><a href="@linkUrl" target="@linkTarget">@item.caption</a></li> } </ul> </li> <li> <a href="/">five</a><span></span> <ul class="nav-menu-sub"> @foreach (var item in CurrentPage.Site().inTheNews) { var linkUrl = (bool)item.isInternal ? Umbraco.NiceUrl(item.Value<int>("internal")) : item.link; var linkTarget = (bool)item.newWindow ? "_blank" : null; <li><a href="@linkUrl" target="@linkTarget">@item.caption</a></li> } </ul> </li> </ul> </nav> @{ IPublishedContent current = (CurrentPage); Stack<dynamic> pages = new Stack<dynamic>(); while (current.Level > 1) { pages.Push(current); current = current.Parent; } } <div class="breadcrumb-bar"> <ul class="breadcrumbs container"> <li><a href="/">Home</a></li> @foreach (var page in pages) { var cls = page.Id == CurrentPage.Id ? "current" : ""; <li class="@cls"><a href="@page.Url">@page.Name.ToLower()</a></li> } </ul> </div> </header> <div class="container body-content"> @RenderBody() </div> <footer> </footer> <script src="//code.jquery.com/jquery-1.11.3.min.js"></script> <script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script> <script src="/bootstrap/js/bootstrap.2.3.2.js"></script> @*<script type="text/javascript" src="/scripts/main.js"></script>*@ <script> var menuItem = $(".nav-menu-main > li > a"); var subMenu = $(".nav-menu-sub") $(subMenu).mouseover(function () { $(this).parent().children(menuItem).addClass("hover-active"); }); $(subMenu).mouseout(function () { $(this).parent().children(menuItem).removeClass("hover-active"); }); </script> </body> </html>

Category:javascript Views:9 Time:2018-12-24

Related post

  • How to use inline JavaScript in HTML? 2011-08-13

    Support that I have this hidden field: <input type='hidden' id='handler' name='handler' value='5534882394' /> And imagine that I fetch an HTML fragment from server via jQuery AJAX. <div id='result'> <span></span> </div>

  • Is using inline JavaScript preferred to an external include if the script is really short? 2011-08-26

    I use External JavaScripts in a website as I always try to keep JavaScript at bottom and external. But Google page speed is giving this suggestion The following external resources have small response bodies. Inlining the response in HTML can reduce b

  • jQuery ajax request and inline javascript 2011-10-17

    Hello fellow Stackoverflow users, I have a page which does a AJAX request to update the shoppingcart. The problem is that the cart has some inline javascript which breaks the page on the ajax request. The following is the ajax request i use: $.ajax({

  • Rails: updating partial dosen't execute inline javascript from the partial 2012-01-30

    I am updating DIV element on Onchange event of dropdown. And I am using partial to replace the content in the DIV. Here is my ajax call: var cach_this = this; $j.ajax({ url: url, context: document.body, complete: function(text,status){ cach_this.runt

  • Rails inline Javascript and Best Practices 2009-02-12

    I'm kinda new to using Rails, and an app I am working on is progressing well - however I'm looking though the generated HTML and noticed things like... <script type="text/javascript"> //<![CDATA[ Droppables.add(...); //]]> </script>

  • Add events to anchors when using link_to and :method => :post instead of inline javascript? 2009-08-17

    So I'm jumping into Ruby on Rails with Agile Web Development with Rails. I got to the part where you use: <%= link_to (image_tag(product.image_url), {:action => :add_to_cart, :id => product}, :method => :post) %> In an attempt to be RE

  • Alternatives to adding dynamically generated inline JavaScript 2009-08-18

    Generating inline JavaScript in HTML has always made me feel dirty and after having used YUI a bit I get the sense that it's best to leverage HTML elements as an alternative. Would it be insane to use a hidden <ul> to store keys and values to b

  • Inline Javascript in rails partials 2009-09-29

    When writing partials in Rails I sometimes feel the urge to use inline Javascript for basic DOM manipulation functions that will only ever be relevant to the HTML in the partial. Should I feel bad about this? My thoughts are that separating out 20 li

  • Proper entity types for XHTML, XML and inside inline JavaScript 2009-11-14

    First, the way I understand it, it's more appropriate to use numeric entities in an XHTML document, such as " instead of &quot;, is that right? Second, for my RSS XML feed, which entity type is correct? Named or numeric? I believe it's numeric, b

  • Why does javascript turn array indexes into strings when iterating? 2009-12-11

    This Javascript logic puzzles me. I'm creating an array and setting the first element of it to a number. When I interate through it using a "for" loop Javascript turns the array key into a string. Why? I want it to stay a number. stuff = []; stuff[0]

  • Minify inline javascript during build for ASP.net? 2009-12-22

    We have a handful of ASP.net pages that include more than 50+ lines of javascript specific to that page. We'd like to minify that javascript during our CruiseControl build process. We already use the YUI Compressor to compress our full javascript and

  • javascript turned off help 2010-01-26

    I am creating a small application where I am displaying some text wrapped in 3 divs so I am actually displaying 1 div at a time also there are prev and next buttons for users to toggle between the div's. Now when javascript is turned off i just want

  • How can I get Firebug to step-through inline javascript code? 2010-02-01

    When my javascript code is contained in a HEAD block in my HTML file, it seems I can't set a breakpoint on it to debug it. How can I do this? this is what I see under the script tag: Odd: when I take the javascript block OUT of my HTML <head> a

  • Trouble moving Inline Javascript to the very end of my html file 2010-02-04

    Is it possible to move a remote inline javascript widget to the very end of my html, and then, once the DOM is ready, inject the widget inside a specific element. I see inline javascript as a candidate for poor performance. Thanks in advance. -------

  • RegEx to extract all HTML tag attributes including inline JavaScript 2010-03-08

    I found this useful regex code here while looking to parse HTML tag attributes: (\S+)=["']?((?:.(?!["']?\s+(?:\S+)=|[>"']))+.)["']? It works great, but it's missing one key element that I need. Some attributes are event triggers that have inline J

  • How do you overwrite an inline javascript event using jQuery? 2010-03-08

    I just came across this weird problem that is happening in IE. In the html I am adding an onclick event to an element that calls a function to change a page like this, onclick="changePage(1, 2);" Inside the changePage function I am changing the curre

  • Inline javascript performance 2010-03-08

    I know it is better coding practice to avoid inline javascript like: <img id="the_image" onclick="do_this(true);return false;"/> I am thinking about switching this kind of stuff for bound jquery click events like: $("#the_image").bind("click",f

  • inline javascript are interrupting the load of the html 2010-03-11

    I want the html are fully loaded then execute the inline javascript because this script stops the load of the html document. To try to solve this problem I put the inline javascript code at the end inside a div then i use the jquery .append method $(

  • is it ok to forget about people without javascript turn on? 2010-04-09

    I am currently building a new style ecommerce shopping cart to test various scenarios and get the best conversion rates. Alot of this will be Javascript based. So I am trying to establish whether we are now in a time where we can simply say we happy

  • Google Translate translates inline Javascript Code 2010-04-16

    I have some PHP code that sends a section of html code including some inline Javascript code by curl to google. When i get it back from Google translated into the language that i chose, the Javascript code has been translated too. Any ideas as to how

  • Alternative to before tag inline Javascript 2010-04-22

    I know inline Javascript is frowned upon and with the new on-the-fly Javascript compressors that check for idle/unused function usage and omit the unused code, it seems good practice to have all your Javascript in an external file. My question is, in

  • Is there a way to trigger inline javascript execution inside some div from jquery? 2010-05-10

    I have some container on a page with inline javascript. Is there a way to trigger its execution once again after it was initially triggered automatically on a page load? <div id="mydiv"> <script type='text/javascript'>alert("trigger me ag

  • jquery - loading inline javascript via AJAX 2010-06-01

    I have thrown together a quick prototype to try and establish a few very basic truths regarding what inline JavaScript can do when it is loaded with AJAX: index.html <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquer

  • Why is loading inline JavaScript inside views with AJAX bad? 2010-06-16

    We have a tabbed interface, inside one of these tabs is a privacy form. This privacy form, as well as using an external JavaScript file for the bulk of its work, also uses inline JavaScript as it currently relies on dynamic code (in the server side l

  • Rendering xhtml compliant pages with XSLT won't render correctly past inline javascript block 2010-07-16

    I'm currently in the process of updating a (lot of) old xsl+html code to render xhtml compliant code but am running up against a problem where pages include inline javascript. Some of the javascript can be removed from being inline and placed into li

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.141 (s). 11 q(s)