Message from JavaScript discussions
April 2018
— Didnt know about it
Hi. I have a page A with ajax code and a page B to which are sent POST request. Is it possible to update content page A without using a db/file that check if a request is sent?
— What you mean? i didnt catch.. can you re-phrase. page content is always static. you can use localstorage of the browser if you need to save some state..
— Uhmmm
— #ask is there any different between use
$(selector)
and difine the selector inside object somethin like
modal: $(selector)
— Rather than repeatly typing
$(selector)
— #solved
— If you mean store the selector in a variable (or in a object property) vs repeatedly typing the selector, the only difference would be time of execution. The later would kind of ensure the element selected exists, the stored one may have an old reference.
— Well, neither would ensure existence
— Simply put: They do different things
— Can you explain why it's different and what make it different ? . I read jquery documentation that selector can be define as variable. simply put
$
at beginning of variable its self. example:
$variable
— The difference is in the time they run