Solved

jquery conflict

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
jQuery delay animation 3 28
replace link with jQuery 4 11
Select case on click 3 14
Button and js nou working 3 6
In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
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)
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

786 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