php tags in .js file

后端 未结 4 1716
名媛妹妹
名媛妹妹 2020-12-15 02:34

How do I enter a in a .js file. This is a jquery app, therefore the js file.

Thanks Jean

4条回答
  •  忘掉有多难
    2020-12-15 02:46

    I think is not possible to enter a php in the js file, but: try to create an element div for example or an input ...

    and then use this functions to get the value of the div tag.

        function AddHiddenValue(oForm) {
           var strValue = document.getElementById("city").value;
           alert("value: " + strValue);
           var oHidden = document.createElement("input");
           oHidden.name = "printthisinput";
           oHidden.value = strValue;
           oForm.appendChild(oHidden);
        }
    

    It come from another object form (select .. )

    document.getElementById("city").value;
    

提交回复
热议问题