简体   繁体   中英

Javascript - How can I get value from HTML return tag

In my project I have two Asp.net pages. The first is the main page and the second is the backend script page. When the user clicks the first page javascript will call the second page and should alert with a message like "Please confirm." but javascript is returning the whole html tag from second page. It doesn't return only error. How can I show the error from second page to render it in the first page? Please help me

1.Javascript code http://www.mx7.com/view2/yCsMjYCaDlYctvSe

2.Return html whole second page http://www.mx7.com/view2/yCsMmssWC8MkqLH8

Dont use Ajax call $.post instead submit your form with form tag. This will fix your issue.

if you want to use $.post method change your server page to retun only alert data instead whole page.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM