Welcome Guest! To enable all features please Login or Register.
Options
View
Go to last post Go to first unread
Offline jerrynott  
#1 Posted : Tuesday, June 15, 2010 11:48:10 PM(UTC)
jerrynott


Rank: YAF Forumling

Reputation:

Joined: 6/10/2010(UTC)
Posts: 6

Thanks: 4 times
I have downloaded and configured YAF to work in our existing website.. great!!

However the exisiting JQuery in the site does not work now. i have tried everything to understand what i need to do to make it work.

The existing jquery that works in all but the forum page looks like this:

$().ready(function() {
$('#dialog'Wink.jqm({ modal: true, onShow: function(h) {
h.w.customFadeIn(888, function() {
//no more fiddling with attributes here
});
}, onHide: function(h) {
h.o.remove(); h.w.customFadeOut(888, function() {
//no more fiddling with attributes here
}); ...


The YAF code appears to add a link that when removed would make it all work. I'm not sure whaere it is added (possibly AJAX ?) the link it adds is:

<script type="text/javascript" src="/WebResource.axd?d=Y-R7W7R ...

(If I copy the page source and run the page without this line (WebResource.axd bit) it works ok.)

Having inspected the WebResource.axd in Firebug I can confirm that it points to an already added Jquery library. (possibly causing the problem)

Can anyone point me in the right direction? What can I do so that the Jquery conflicts that occur when the WebResource is linked in. Is there a way of preventing the WebResource.axd link from being inserted by YAF?

Any help would be really appreciated,
Thanks

Edited by user Tuesday, June 15, 2010 11:49:54 PM(UTC)  | Reason: Not specified

Sponsor
Offline bbobb  
#2 Posted : Wednesday, June 16, 2010 1:57:26 AM(UTC)
bbobb


Rank: YAF Developer

Reputation:

Medals: Medal of Honor Key: Given to pillars of the community who are key players in the YAF community and project.Medal of Honor for a YAF Database Key Player: Holds the key to YAF database. Bow down!Medal of Honor for the Support King: Given for answering tons of support questions and generally helping the community.Medal of Honor for the Support Knight: Given to a community member who has answered lots of support questions.

Joined: 10/21/2008(UTC)
Posts: 1,552
Man
Russian Federation
Location: Moscow

Thanks: 46 times
Was thanked: 284 time(s) in 250 post(s)
As far as I can see from the source code, YAF checks DNN loaded Jquery and if it's already loaded, doesn't load it. It's not a case with other portals|soft.
YAF uses JQuery 1.4.2 and JqueryUI 1.8.1 and these are hardcoded.
thanks 2 users thanked bbobb for this useful post.
jerrynott on 6/16/2010(UTC), thienvc on 2/27/2011(UTC)
Offline jerrynott  
#3 Posted : Wednesday, June 16, 2010 4:46:19 AM(UTC)
jerrynott


Rank: YAF Forumling

Reputation:

Joined: 6/10/2010(UTC)
Posts: 6

Thanks: 4 times
Hi. So is there a way of preventing YAF from outputting the javascript link to the JQuery 1.4.2 that is in the webresource.
ie prevent the following line from being added.

<script type="text/javascript" src="/WebResource.axd

The reason is our site already uses JQuery 1.4.2 and the duplicate script include causes errors.

Thanks for the reply.Confused
Offline jerrynott  
#4 Posted : Wednesday, June 16, 2010 4:59:18 PM(UTC)
jerrynott


Rank: YAF Forumling

Reputation:

Joined: 6/10/2010(UTC)
Posts: 6

Thanks: 4 times
I can add some more info to this problem.

I am using the YAF inside my website. I have a master page that contains a login control that uses the JQuery modal script - jqModal.js and jquery-1.3.2.min.js among others. This works well on all the pages apart from the forum page.

The forum appears to add the line
<script type="text/javascript" src="/WebResource.axd?d=Y-R7W7RPhwfD8CWt9Fh5AsVxuHHLPuRISYy0SVm8bUo1&amp;t=633918208320000000"></script>

when inspected using firebug this WebResource contains jquery-1.3.2.min.js. This prevents the modal dialog boxes from working. An error "object does not support this property or method" occurs when the modal window is setup:

The top of the pages rendered source is attached. the error occurs on the following ready function:

$().ready(function() {
$('#dialog'Wink.jqm({ modal: true, onShow: function(h) {
h.w.customFadeIn(888, function() {
//no more fiddling with attributes here
});
}, onHide: function(h) {
h.o.remove(); h.w.customFadeOut(888, function() {
//no more fiddling with attributes here
});

}
});


Can anyone help me? Please!

Edited by user Wednesday, June 16, 2010 5:02:47 PM(UTC)  | Reason: Not specified

File Attachment(s):
pagesource.txt (4kb) downloaded 12 time(s).
Offline garyn  
#5 Posted : Wednesday, June 16, 2010 8:11:12 PM(UTC)
garyn


Rank: YAF Forumling

Reputation:

Joined: 6/16/2010(UTC)
Posts: 1

I have the exactly the same problem. My master page contains JQuery includes that are broken / conflict with the same include in the WebResource.axd file that is added by the YAF stuff.

I'm still searching for a way around this too. Surely otherpeople have had JQuery in their master pages and incoporated YAF. And had the same duplicate JQuery problems.

Anyone?
Offline Mek  
#6 Posted : Thursday, June 17, 2010 2:11:23 AM(UTC)
Mek


Rank: YAF Developer

Reputation:

Medals: Medal of Honor Key: Given to pillars of the community who are key players in the YAF community and project.Medal of Honor for the Support King: Given to a community member who tirelessly answers tons of support questions.

Joined: 7/12/2005(UTC)
Posts: 1,705

Thanks: 5 times
Was thanked: 21 time(s) in 19 post(s)
Yeah we really need a way of updating and disabling JQuery for both YAF and DNA through the web.config.

Try using
Code:

protected override void OnInit(EventArgs e)
{
HttpContext.Current.Items["AddJQueryRegistedHandler"] = true; // Disable DNA's stupid JqueryRegistration
base.OnInit(e);
}


In the code behind of your MasterPage, see if that helps. I can't remember what other changes I made to get round this problem.

I think this successfully disables the Jquery for both YAF and DNA. The problem I then had was there no quick hack to get around DNA inclusion of the Jquery UI.

UserPostedImage

"It's a case of RTFM.. the only problem being we don't have a manual!"

When I post FP:Mek in a topic, I'm leaving my footprint there so I can track it once I get into coding/supporting. (Yes I stole this off Ederon Smile )
thanks 1 user thanked Mek for this useful post.
jerrynott on 6/17/2010(UTC)
Offline joebone  
#7 Posted : Wednesday, July 14, 2010 8:21:06 AM(UTC)
joebone


Rank: YAF Forumling

Reputation:

Joined: 7/14/2010(UTC)
Posts: 1

Hello Smile The above code cut out the Jquery registration which is awesome, but not the Jquery UI one - we have the same problem as everyone else, but it is the inclusion of the Juqery UI that is now causing issues. I don't suppose you know of any secret context setting that prevents UI from being loaded twice. Usually I would just hide our own include, but it seems to load ui, draggable, resizable, and dialog (and all of version 1.7.1) and we use others including button and datepicker, and from version 1.8.2...

You would be an absolute legend if you could point me in the right direction - I downloaded the source to DNA and had a search through it, but the only other references to HttpContext.Current.Items i could find was this:

string key = "JQuery-Javascripts";
if (HttpContext.Current.Items[key] == null)
Offline bbobb  
#8 Posted : Wednesday, July 14, 2010 8:31:13 AM(UTC)
bbobb


Rank: YAF Developer

Reputation:

Medals: Medal of Honor Key: Given to pillars of the community who are key players in the YAF community and project.Medal of Honor for a YAF Database Key Player: Holds the key to YAF database. Bow down!Medal of Honor for the Support King: Given for answering tons of support questions and generally helping the community.Medal of Honor for the Support Knight: Given to a community member who has answered lots of support questions.

Joined: 10/21/2008(UTC)
Posts: 1,552
Man
Russian Federation
Location: Moscow

Thanks: 46 times
Was thanked: 284 time(s) in 250 post(s)
1.9.4 final loads JQuery-UI 1.8.2
DNA uses 1.7.x, but it should not mess up things, but css in yaf themes.
The scripts are renamed and you should not have troubles.
Rss Feed  Atom Feed
Users browsing this topic
guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Notification

Icon
Error