How to use swift variables in html code?

Hey,

I try to use swift variables in html code. Here is my code:

//Begin

testVar = webView.evaluateJavaScript(“document.getElementsByTagName(‘table’)[1].getElementsByTagName(‘tr’)[1].getElementsByTagName(‘td’)[0].innerText”, completionHandler: nil)

 

webView.loadHTMLString(“””

       

           

               

           

                   

               

               

                   

                   

               

               

                   

                   

               

       

                TableName

           

“(testVar)” Hello
Hello World!    test
Test Hello

        “””, baseURL: nil)

//End

The html task returns “VId” by using the html task document.getElementsByTagName… on the website console. But by using it in xCode, it returns “()”.

Hope you have an idea^^

PS: Sry for my bad english

Powered by WPeMatico

About

You may also like...

Comments are closed.