Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript How to pass variable from php loop to javascript/ajax function

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #286887
    snippet248
    Participant

    I have set a variable “id_ajax” inside php loop of wordpress, but I can’t seem to pass that variable to the ajax javascript code. The whole point of doing this is to reduce the code length by using a variable instead of having the code repeated for each instance of ajax.
    Tried this without luck; it displays nothing:

    Edit: my php code gets truncated, how do I post it here? For now I will describe it: defined a variable in javascript that is set to the echo of the php variable.

Viewing 1 post (of 1 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.