Solved

jquery conflict

Posted on 2013-11-06
5
277 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
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 28

Expert Comment

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

See docs @

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

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
CSS Scroll Issue 3 81
Adding a Li to a UL after a specified Li contents 2 42
alert before form submission 6 27
JavaScript: Issue with onClick 5 34
Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
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)

919 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now