This is a migrated thread and some comments may be shown as answers.

jQuery(document).ready(function () not working

2 Answers 322 Views
Editor
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Prashanth
Top achievements
Rank 1
Prashanth asked on 09 Jan 2012, 01:56 PM
HI,
i am having an editor in a Partial view.   so the ScriptRegistrar() is calling on the bottom of the page.

i am having another jQuery(document).ready(function () event on the parent form.  so both of these are conflicting while run-time. and the functionality for my custom ready() function is not working..

Is there any solution for avoiding this problem...

Please send me a solution for the issue.

Thanks and Regards

Prashanth

2 Answers, 1 is accepted

Sort by
0
Jonathan
Top achievements
Rank 1
answered on 11 Jan 2012, 05:54 PM
I am having the same issue, did you find a fix?
0
Prashanth
Top achievements
Rank 1
answered on 16 Jan 2012, 07:48 AM
yes i solved the issue..

in the parent form 

@(Html.Telerik().ScriptRegistrar().Globalization(

 

true).DefaultGroup(group => group.Combined(true).Compress(true)))




on the Partial View or content page
write the onReady function in a variable and bind the onready to the telerik onready event

@{

var onready = "$('ul.css-tabs').tabs('div.css-panes > div');
$('#tooltip img[title]').tooltip({ effect: 'toggle' });
$('tr').mouseover(function () {
$(this).addClass(over);
});
$('tr').mouseout(function () {$(this).removeClass('over');});
$('tr:odd').addClass('alt');"
;

}

@(Html.Telerik().ScriptRegistrar().OnDocumentReady(onready))

OR

we can create a seperate Javascript file and write the onready FUntion in that file. and refer the Javascript file reference on the partial page.

Note : Always this problem is comming because of the referencing of the external js file. try putting the reference in _layout page or Master Page.

 

 

 

 

 

 

 

Tags
Editor
Asked by
Prashanth
Top achievements
Rank 1
Answers by
Jonathan
Top achievements
Rank 1
Prashanth
Top achievements
Rank 1
Share this question
or