Solved

jquery conflict

Posted on 2013-11-06
5
292 Views
Last Modified: 2014-11-03
I have mvc app. it is very simple and have one view (date picker).
The issue is when I addded

 <script src="../../Scripts/jquery.js" type="text/javascript"></script>

in the _layout.cshtml. The data picker in jquery is no longer working.

And just wonder how to fix it.

Thanks

codes below

 <title>@ViewBag.Title</title>
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>


    <link href="@Url.Content("http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.10/themes/redmond/jquery-ui.css")" rel="Stylesheet" type="text/css"   />

    <script src="@Url.Content("~/Scripts/jquery-ui-1.8.11.min.js")" type="text/javascript"></script>
0
Comment
Question by:solution1368
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 39628816
What is jquery.js? You say conflict - what is conflicting?
0
 
LVL 43

Expert Comment

by:Chris Stanyon
ID: 39628884
Difficult to say without seeing the generated HTML, but from what you've shown it looks like you might be including 2 different jQuery libraries: jquery-1.5.1.min.js and jquery.js. That will cause conflict.
0
 

Author Comment

by:solution1368
ID: 39629073
Chris: Yes, I agree, just don't know how to fix it.
0
 
LVL 43

Accepted Solution

by:
Chris Stanyon earned 500 total points
ID: 39629084
You said the issue started when you added:

<script src="../../Scripts/jquery.js" type="text/javascript"></script>

so don't add it!

If you're already including jQuery once, why do you need to add it again?
0
 
LVL 29

Expert Comment

by:Pravin Asar
ID: 40420866
You may use noconflict() method.

See docs @

http://api.jquery.com/jquery.noconflict/
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question