jQeury and Sitefinity conflicts
I'm trying to use SF4.1 and jquery library jquery.simplemodal-1.4.1.js
The issur is not related just to the library but to the way of declaring functions lie $.name = function () ; anywayre in javascript
I've tried to isolate the case and found the cause
The issue is caused by Telerik.Web.UI.WebResource.axd. Once I remove this call and the sys calls it's working.
I've attached an html file with this issue (the html was inside the project therefore the axd file was taken correctly)
If you remove the content between the blocks REMOVE FROM HERE to block UNTIL HERE and Click on the button a div with "my data" appears.
Please tell me if you know why Telerik.Web.UI.WebResource.axd would conflict with the jQuery standard way of defining functions.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
><
title
>
test1
</
title
>
<
script
src
=
"Resources/Js/jquery-1.4.1.min.js"
type
=
"text/javascript"
></
script
>
<
script
src
=
"Resources/Js/jquery.simplemodal-1.4.1.js"
type
=
"text/javascript"
></
script
>
<
meta
name
=
"Generator"
content
=
"Sitefinity 4.1.1395.0 SE"
/></
head
>
<
body
>
<
form
method
=
"post"
action
=
""
id
=
"form1"
>
<
div
class
=
"aspNetHidden"
>
<
input
type
=
"hidden"
name
=
"ctl03_TSM"
id
=
"ctl03_TSM"
value
=
""
/>
<
input
type
=
"hidden"
name
=
"ctl04_TSSM"
id
=
"ctl04_TSSM"
value
=
""
/>
<
input
type
=
"hidden"
name
=
"__EVENTTARGET"
id
=
"__EVENTTARGET"
value
=
""
/>
<
input
type
=
"hidden"
name
=
"__EVENTARGUMENT"
id
=
"__EVENTARGUMENT"
value
=
""
/>
<
input
type
=
"hidden"
name
=
"__VIEWSTATE"
id
=
"__VIEWSTATE"
value
=
"/wEPDwULLTE2MjA4NzY4NjRkGAEFHl9fQ29udHJvbHNSZXF1aXJlUG9zdEJhY2tLZXlfXxYBBSVjdGwwMCRjdGwwNiRjdGwwMCRjdGwwMCR3aW5kb3dNYW5hZ2Vyp8ja6nCG1ge6SS2/HMHs2A7eX0ifIhHlmfY7Mv5uetE="
/>
</
div
>
<
script
type
=
"text/javascript"
>
//
<![CDATA[
var theForm = document.forms['form1'];
if (!theForm)
theForm = document.form1;
function __doPostBack(eventTarget, eventArgument)
if (!theForm.onsubmit || (theForm.onsubmit() != false))
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
//]]>
</
script
>
<!-- ================================================ REMOVE FROM HERE ======================================================== -->
<
script
src
=
"/TestProject/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl03_TSM&compress=0&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen%3a1f68db6e-ab92-4c56-8744-13e09bf43565%3aea597d4b%3ab25378d2%3bTelerik.Sitefinity.Resources%3aen%3ac58a2477-603d-4b5e-87a2-ca44c02d9ecd%3ab010fa2f%3a7ee0bb1f%3a83eb063b%3a1939e47e%3a24e33f3%3bTelerik.Sitefinity%3aen%3a23b191f9-0e65-49d2-9fd3-ce236417ac7b%3a993d8e92%3a5b182b17%3a81554a3f%3afe4b1370%3aaa9a9de0%3bTelerik.Web.UI%2c+Version%3d2011.1.413.40%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen%3a71598907-ed61-48cf-848a-7bcbb14d6dd6%3a16e4e7cd%3af7645509%3a24ee1bba%3af46195d3%3a19620875%3a874f8ea2%3a490a9d4e%3abd8f85e4%3bTelerik.Sitefinity%2c+Version%3d4.1.1395.0%2c+Culture%3dneutral%2c+PublicKeyToken%3db28c218413bdf563%3aen%3a23b191f9-0e65-49d2-9fd3-ce236417ac7b%3a80c147f%3af77740f1%3a26cfb6dc%3a6e04508f%3bTelerik.Sitefinity.Resources%3aen%3ac58a2477-603d-4b5e-87a2-ca44c02d9ecd%3ac4ef6dcd%3a6f03d72a%3bTelerik.Sitefinity%2c+Version%3d4.1.1395.0%2c+Culture%3dneutral%2c+PublicKeyToken%3db28c218413bdf563%3aen%3a23b191f9-0e65-49d2-9fd3-ce236417ac7b%3ac1fc658e%3a447a22b8%3bTelerik.Sitefinity.Resources%3aen%3ac58a2477-603d-4b5e-87a2-ca44c02d9ecd%3a1077b7cd%3bTelerik.Sitefinity%2c+Version%3d4.1.1395.0%2c+Culture%3dneutral%2c+PublicKeyToken%3db28c218413bdf563%3aen%3a23b191f9-0e65-49d2-9fd3-ce236417ac7b%3ade209ee7%3a688a162a"
type
=
"text/javascript"
></
script
>
<
script
type
=
"text/javascript"
>
//
<![CDATA[
if (typeof (Sys) === 'undefined') throw new Error('ASP.NET Ajax client-side framework failed to load.');
//]]>
</
script
>
<
div
class
=
"aspNetHidden"
>
<
input
type
=
"hidden"
name
=
"__EVENTVALIDATION"
id
=
"__EVENTVALIDATION"
value
=
"/wEWAwKSoon0DwL4nKDeCwKo3vSQCPRLnmEsHc9662WTqdXdwRqxRYIKPHwiBGJf1IG9L8n2"
/>
</
div
><
script
type
=
"text/javascript"
>
//
<![CDATA[
Sys.WebForms.PageRequestManager._initialize('ctl00$ctl03', 'form1', [], ['ctl00$ctl03', 'ctl03'], [], 90, 'ctl00');
//]]>
</
script
>
<
input
type
=
"hidden"
name
=
"ctl00$ctl03"
id
=
"ctl03"
/>
<
script
type
=
"text/javascript"
>
//
<![CDATA[
Sys.Application.setServerId("ctl03", "ctl00$ctl03");
Sys.Application._enableHistoryInScriptManager();
//]]>
</
script
>
<!-- ================================================ UNTIL HERE ======================================================== -->
<
div
>
<
input
type
=
"button"
value
=
"click"
onclick
=
"Test()"
/>
<
script
>
function Test()
$.modal('<
div
>my data</
div
>', opacity: 80, close: true, closeClass: 'close' );
</
script
>
</
div
>
</
div
>
</
form
>
</
body
>
</
html
>
Hi FlR,
Thank you for contacting us.
The current version Sitefinity uses is 1.5.2. The issue you are facing using 1.4.1
is described in this forum.
The conflict is caused because Telerik.Web.UI.WebResource.axd contains jquery functions.
Please take a look at this forum thread if you need to use 1.5.1 at some stage.
Best wishes,
Stanislav Velikov
the Telerik team