jquery ajax get return value

后端 未结 7 1554
不知归路
不知归路 2021-01-21 04:22

i want to get the \'printed value\' of html pages.

i tried below query, but showGetResult() just return \'null value\'

but my apache server logs printed i access

7条回答
  •  孤城傲影
    2021-01-21 05:00

    You're missing a fundamental point here. The success method is not run when you call showGetResult. It is run asynchronously.

    At the point that you put return result; it is still null (because success has not yet been invoked).

    What you need to do is have document.write execute after success is invoked. Either like this:

    
    

    Or with a callback:

    
    

提交回复
热议问题