Object of Type 'string' cannot be converted to type 'function'

Source: Internet
Author: User

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0 ;. net CLR 1.1.4322 ;. net CLR 2.0.50727 ;. net CLR 3.0.04506.648 ;. net CLR 3.5.21022 ;. net CLR 3.0.20.6.2152 ;. net CLR 3.5.30729)
Timestamp: Mon, 14 Dec 2009 03:32:55 UTC

Message: SYS. argumenttypeexception: object of Type 'string' cannot be converted to type 'function '.
Parameter Name: onsuccess
Row: 4770
Character: 16
Code: 0
Uri: http: // localhost: 6388/webs/scriptresource. axd? D = d_Q0Ax-QZTcQtQQuRVnReSXMBgbLxa9q5v8DUZS_lb-grRlT4kz_QlCwFukd _ 2yg-agg-i8oiuslqy4iren3muq0qai5kofzpariipkpkq1 & t = 633958669188906250

The preceding error occurs when Ajax calls WebService. No answer was found online, and the reason is finally found today.
It's easy. When writing JavaScript Functions, do not write anything if there is no value passed in.
Correct syntax:

Function btngetdatatable_onclick () {userservice. listtestusers (onsucceeded, onfailed );}

Incorrect syntax:

 
Function btngetdatatable_onclick () {userservice. listtestusers ("", onsucceeded, onfailed );}

Having no theoretical experience is nothing more than an empty talk.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.