EcshopAjax. call problems

Source: Internet
Author: User
Write the index. dwt file for ecshopAjax. call problems
Ajax. call ('index. php', 'Act = aaaa & items = '+ items, bbbb, 'get', 'json') // success

Write in the category. dwt file
Ajax. call ('Category. php', 'Act = aaaa & items = '+ items, bbbb, 'get', 'json') // failed
Ajax. call ('index. php', 'Act = aaaa & items = '+ items, bbbb, 'get', 'json') // success
Ajax. call ('Category. php', 'intro = aaaa & items = '+ items, bbbb, 'get', 'json') // success

Written in brand. dwt file
Ajax. call ('index. php', 'Act = aaaa & items = '+ items, bbbb, 'get', 'json') // success
Ajax. call ('brand. php', 'Act = aaaa & items = '+ items, bbbb, 'get', 'json') // The call fails.

. The code in php is the same. After I try it, it seems that only the index page can be used. for other pages, if the path is to index. php can also be successful, but give your own files (such as: brand. to brand. php). the error "Uncaught transport" is returned. js/parseResult () error: can't parse to JSON.
I read the js files to be called on the homepage. Other pages are also called. The above error indicates that jquery is in conflict on the Internet, so why is the homepage okay?


Reply to discussion (solution)

Uncaught transport. js/parseResult () error: can't parse to JSON.
The json format is incorrect and cannot be parsed.

Apparently, you have output something when outputting the json string.

I used a tool on the Google browser to check whether items has a value after I triggered it, but there is a string of numbers below, which should not be affected. After triggering, I did not go to the php file. I can go to index. php but cannot go to other php files. what is the sentence in index. php file parsing JSON format?

We can only talk about things. you don't even provide valuable information. How can we expect to solve the problem?

If you can analyze the problem on your own, it seems that there is no need to post here.

Why should I use the built-in one? Can't I use jquery to write one directly?

Sorry! It may be that I am a little anxious about this issue. I have not provided you with comprehensive information and I am sorry for it.

Js files
Function aaaa (id)
{
// Alert (id );
// Ajax. call ('brand. php', 'Act = bbbb & id = '+ id, cccc, 'get', 'json ');
Ajax. call ('index. php', 'Act = bbbb & id = '+ id, cccc, 'get', 'json ');
}

Function cccc (rest)
{
Alert (rest. content );
}

Php files
$ Act =! Empty ($ _ GET ['AC'])? $ _ GET ['AC']: '';
If ($ act = 'bbbbb ')
{
$ Id = $ _ GET ['id'];
$ Result = array ('content' => '');
Include_once ('Des/cls_json.php ');
$ Json = new JSON;
$ Result ['content'] = $ id;
Die ($ json-> encode ($ result ));

}
This is the code I tested. I just tested it, Ajax. the path in the call is to brand. php will not pop up, Ajax. call path to index. php is normal. the above code is used.

Except for the reason I said
You have to check whether your project is a single-entry project. if so, brand. php cannot be directly accessed.

Www.xxx.com/index.php can be accessed on the homepage.
Www.xxx.com/brand.php can be accessed to the brand page
Can this indicate that it is not a single entry project? in addition to this direction, there are also some possible causes?

I have encountered this problem now.

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.