c# - Some javascript runs and some doesn't -



c# - Some javascript runs and some doesn't -

i'm not sure when started happen. development environment in c#/vs2013 looking great new code (ajax) had been working on. went deploy code beta site , of javascript code wasn't working (the tab menu on 1 page simulated below).

i went dev environment , saw working in ie fine not in firefox or chrome. in attempting clean broke in ie guess thing in have way troubleshoot/verify issue now.

i created test page in project , copied in tab controller test.

@section scripts { <script type="text/javascript"> $(function () { $("#tabs").tabs(); }); alert("test"); </script> } <body> <div id="tabs"> <ul> <li><a href="#tabs-1">tab1</a></li> <li><a href="#tabs-2">tab2</a></li> </ul> <div id="tabs-1"> tab 1 </div> <div id="tabs-2"> tab 2 </div> </div>

the alert() fires when phone call page know javascript running. also, tab controller creates tabs @ top of page both tab1 , tab2 show , tabs don't toggle pages.

the menu options twitter bootstrap menus work no issues.

my layout.cshtml has next towards top:

@scripts.render("~/bundles/jquery") @scripts.render("~/bundles/knockout") @scripts.render("~/bundles/modernizr")

and after renderbody section: (i've tried playing placement of above section , rendersection scripts below.)

@rendersection("scripts", required: false)

bundleconfig.cs has this:

public static void registerbundles(bundlecollection bundles) { registerstylebundles(bundles); bundles.add(new scriptbundle("~/bundles/jquery") .include("~/scripts/jquery-{version}.js") .include("~/scripts/jquery-ui-{version}.js") .include("~/scripts/jquery.unobtrusive*") .include("~/scripts/jquery.validate*") .include("~/scripts/jquery.migrate-121.min.js") .include("~/scripts/bootstrap.js") ); bundles.add(new scriptbundle("~/bundles/knockout").include( "~/scripts/knockout-{version}.js")); bundles.add(new scriptbundle("~/bundles/modernizr").include( "~/scripts/modernizr-*")); bundles.add(new stylebundle("~/content/themes/base/css").include( "~/content/themes/base/jquery.ui.core.css", "~/content/themes/base/jquery.ui.resizable.css", "~/content/themes/base/jquery.ui.selectable.css", "~/content/themes/base/jquery.ui.accordion.css", "~/content/themes/base/jquery.ui.autocomplete.css", "~/content/themes/base/jquery.ui.button.css", "~/content/themes/base/jquery.ui.dialog.css", "~/content/themes/base/jquery.ui.slider.css", "~/content/themes/base/jquery.ui.tabs.css", "~/content/themes/base/jquery.ui.datepicker.css", "~/content/themes/base/jquery.ui.progressbar.css", "~/content/themes/base/jquery.ui.theme.css")); } private static void registerstylebundles(bundlecollection bundles) { bundles.add(new stylebundle("~/css") .include("~/content/bootstrap.css") .include("~/content/bootstrap-responsive.css") .include("~/content/site.css")); } }

in firebug i'm not seeing errors other list of css issues seem related versioning , according jquery site ignored. (they there before whole thing started happen).

nuget shows it's removing older versions of jquery project doesn't remove jquery files. reply remove older versions scripts folder in project outsite of visual studio.

c# javascript jquery

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -