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

Error when using jQuery

4 Answers 80 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kaleem Khan
Top achievements
Rank 1
Kaleem Khan asked on 17 Dec 2009, 08:35 PM
I have a ScriptManager in Master page and jquery script like this:

<script type="text/javascript">
        $(document).ready(

     function () {
                    $('input#tmpDate1').click(main);
                    $('input#tmpDate').click(main);
                }       );
</script>

The following control is on Home Page:
<input type='text' id='tmpDate1' size='25' value=''/> 

and then <input type='text' id='tmpDate' size='25' value=''/> on another aspx linked from Home page.

I get the error: Microsoft JScript runtime error: Object expected


Excluding Script registrar and including scripts in head solves the problem on Home page and see the alert dialog as expected but navigating to linked aspx from Home pages shows the same error as above. 



 

4 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 18 Dec 2009, 10:46 AM
Hello Kaleem Khan,

Your question does not seem related to RadControls, but I recommend you to debug the web page when the error occurs, and see which object is null. This should give you clue what to modify in the implementation.

Greetings,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Kaleem Khan
Top achievements
Rank 1
answered on 18 Dec 2009, 02:55 PM
thanks for your reply but I think it is related. please see this forum

http://www.telerik.com/community/forums/aspnet-mvc/general/scriptregistrar-looking-for-jquery.aspx

Why I'm not able to use native jQuery API when using ScriptRegistrar. There is one wrok around suggested in that forum but I'm not sure how to implement
0
Atanas Korchev
Telerik team
answered on 18 Dec 2009, 03:13 PM
Hi Kaleem Khan,

The ScriptRegistrar outputs the jquery scripts at the same place where it is defined. If your code is above the scriptregistrar the jquery scripts will not be loaded and "$" will not be defined. Make sure this is not the case.

Regards,
Atanas Korchev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Kaleem Khan
Top achievements
Rank 1
answered on 18 Dec 2009, 03:20 PM
That works like a charm. thanks.
Tags
General Discussions
Asked by
Kaleem Khan
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Kaleem Khan
Top achievements
Rank 1
Atanas Korchev
Telerik team
Share this question
or