Solved

jquery conflict

Posted on 2013-11-06
5
284 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
VBScript on Html 15 47
PHP and JQuery Syntax question 4 26
Use Images instead of radio button and get the checked value and pass it to a h2 tag 3 17
JQuery Search Filter 2 28
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…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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…

840 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