javascript - How do I make the action of my form the src of my iframe -
& lt; form id = "submit" action = "" method = "post" & gt; IFrame के स्रोत के लिए डेटा सबमिट करने के लिए मुझे अपने फॉर्म की आवश्यकता है। यूजर एक्शन के आधार पर यह एसआरसी लगातार बदलता रहता है।
& lt; iframe id = "iframe" src = "math_iframe.php" width = "100%" height = "100%" & gt; & lt ; / iframe & gt; इसलिए मैं इसे
& lt; form id = "submit" action = "& lt; iframe src =" math_iframe.php जैसा कुछ करना चाहता हूं "" विधि = "पोस्ट" & gt; कृपया ध्यान दें: मुझे मौजूदा पृष्ठ पर रहने की इच्छा है।
jQuery का उपयोग करें:
$ ('# submit')। पर ('सबमिट', फ़ंक्शन (e) {$ (this) .attr ('action', $ ('# iframe')। attr ('src'));}); डेमो:
Comments
Post a Comment