Ajax returns FlowPlayer error caused by string type P.replace is not a function problem

Source: Internet
Author: User

Today with FlowPlayer pull the flow encountered a more wonderful problem, the general idea is JS based on the name of the page using AJAX to get the number from the background, and then use the number to create a task output rtmp stream, FlowPlayer to play, But FlowPlayer initialization of the time reported a p.replace is not a function error, roughly speaking FlowPlayer library of some functions do not define it, has been thought to be a library reference problem, for a half-day has not been resolved, the last layer of tracking, Found directly with the name of the creation of the task is normal, according to the number is not normal, all the problems are definitely in the Ajax get number This step, the beginning of writing is to return a String, instead of returning list<string>, this problem is very covert, Because the tracking code when the string is returned, the returned value is normal, the estimated format is not correct, resulting in a subsequent error, the errors are in the reference Library JS code. The following code is attached.

Java code:

@RequestMapping (value = "Getterminalnumber")
	@ResponseBody public
	list<string> Getterminalnumber (@ Requestparam String name) {//note, returns the List type
		list<string> checkret = new arraylist<string> ();
		String number = "";
		list<terminalconfigpo> Terminalconfigpos = Terminalconfigdao.findbyfield ("TerminalName", name);
		if (Terminalconfigpos.size () >0) {Number
			= Terminalconfigpos.get (0). Gete164number ();
		Checkret.add (number);
		return checkret;
	}

JS Code:

var Telnumber;
		$.ajax ({
			type: "POST",
			URL:   path+ '/ajax/getterminalnumber ',
			cache:false,
			async:false,		/ /sync
			data:{"name": name},
			DataType: "JSON",
			success:function (ret) {
				if (ret.length>0) {
					Telnumber = ret[0];
				}
			,
			error:function (ret) {
				return;}
		});



Related Article

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.