Saving Javascript and Sync'd Server Code

Today, the most common class of errors that I get are interface problems between javascript and server code. This includes having javascript causing the wrong url, sending the wrong data (especially if the needs of what needs to be transferred is changing, and javascript doesn't), and problems turning the data into html just like my application does .

Is there an easy way to handle this? I am currently developing the Zend Framework in PHP. I think the first two problems could have been avoided by using Selenium, but I'm not sure how to deal with the data → html problem. I would like some kind of javascript to be equivalent to my ZF type helpers, but I'm not sure how possible this is.

+3
source share
1 answer

On a well-designed site, (publicly accessible) URLs will not change. Of course, you can freely use any internal structure.

If necessary, you should be able to generate JS just like you create HTML. However, if you apply the correct REST principles :

API REST - URI () , (.. , , API). , , .

, , , , XPath jQuery, , DOM , .

+2

Source: https://habr.com/ru/post/1793473/


All Articles