Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Mobile-Applications UIWebView call javascript function

Have Programming Question? Ask it here!
 
 
 


Deepak Kumar
UIWebView call javascript function
1 Answer(s)      3 years and 8 months ago
Posted in : MobileApplications


Hi,

I am developing web browser for iPhone and iPhone devices. I want to call the java script in my html page from UIWebView. Please let's know how to call JavaScript function from objective c code?

Thanks


Advertisement
View Answers

December 23, 2010 at 6:39 PM


Hi,

You should develop javascript in your html file say:

<Script Language="JavaScript">
function sayHello(){
 alert("hello");
}

</Script>

Now in your objective c code add the following line to call javascript function:

[webView stringByEvaluatingJavaScriptFromString:@"sayHello()"];

Thanks



Related Tutorials/Questions & Answers:
UIWebView call javascript function
from UIWebView. Please let's know how to call JavaScript function from objective c...UIWebView call javascript function  Hi, I am developing web browser... to call javascript function: [webView stringByEvaluatingJavaScriptFromString
UIWebview javascript tutorial
UIWebview javascript tutorial  Hi, How to call javascript function... use the stringByEvaluatingJavaScriptFromString function of UIWebview class to call JavaScript method. Here is example: [webView
Advertisements
function call in javascript - Java Beginners
function call in javascript  hi all, i've written a javascript , but i m unable to call a function getExpression.i dont know why getExpression function is not being called. heres my code : function
Scrolling UIWebView JavaScript
Scrolling UIWebView JavaScript  Hi, i am looking for an example code to make a scrolling function for UIWebView in JavaScript. Thanks
how to call javascript function from flex
how to call javascript function from flex  how to call javascript function from flex
UIWebview javascript callback
UIWebview javascript callback  HI, In my iPhone application I am loading a web page in UIWebView. There is a button on my web page. On button click... of uiwebview javascript callback. Thanks
Flex - Call JavaScript Function And Open a Popup Window that Displays Data
Flex - Call JavaScript Function And Open a Popup Window that Displays Data  Flex - Call JavaScript Function And Open a Popup Window that Displays Data
how to call the array variable in scriptlet from javascript function
how to call the array variable in scriptlet from javascript function  This is the scriptlet code:- <% String[] abc={"saab","volvo","bmw","Benz... and display them in the dropdown list by using the below function function myFunction
call function in php
call function in php  What is the call function in PHP please explain
call to a member function
call to a member function  While uploading the data on server i am getting following error... call to a member function children
php function call
php function call  I have an function in error-status.php like this function validateHostName($hostName) { if((strpbrk($hostName,'`~!@#$^&... to cal this function in my other page which is datetime.php how it is posible
Invoke JavaScript function from servlet
Invoke JavaScript function from servlet You have learnt several servlet related examples. Here we are going to create an example that will call JavaScript function from the servlet. Embedding JavaScript in Servlets can be useful when
Calling Flex Function From JavaScript
From JavaScript Sometimes, you may need to call flex function from JavaScript... by JavaScript to call the flex function, and the second parameter is the actual... function callable from javascript. ExternalInterface.addCallback
Calling Anonymous JavaScript Function From Flex
: #FFFFCC; } Calling Anonymous JavaScript Function From Flex In flex application, you can call javascript function defined in html file where your flex file is embed. But you can also call an anomymous javascript function
call a function - Java Interview Questions
call a function  Please i want to call the function union via main...}, }; //calling the function union : paramtere to pass is mat //how i call it } }   Hi Friend, Please post your problem
error call to undefined function mysql_connect
error call to undefined function mysql_connect  what is error call to undefined function mysql_connect
javascript function - Development process
javascript function  I'm trying to use a remote menu with 4 different menu options. i put the menu names in an array, then tried to call up the on click function with an id number. I've tried everything and nothing works
javascript abort function
javascript abort function   I am running a loop and wants to abort it after a specific time. How is it possible using JavaScript Abort function..?   Using JavaScript we can abort function or loop. See the the code below
database call from javaScript - Ajax
database call from javaScript  Dear All, In my project i have one... name. and i have to do this in javascript.How do i call database query ,if suppose i have selected two building from text area,i have to finish
javascript onclick function
javascript onclick function  javascript onclick function   <html> <head> <script language="javascript"> function...; For more information, visit the following link: http://www.roseindia.net/javascript
uiwebview stringbyevaluatingjavascriptfromstring example
uiwebview stringbyevaluatingjavascriptfromstring example  Hi, Can anyone share example code for using uiwebview stringbyevaluatingjavascriptfromstring function? thanks
javascript call action class method instruts
javascript call action class method instruts  in struts2 onchange event call a method in Actionclass with selected value as parameter how can i do
if else in javascript function
if else in javascript function  How can i write the else statement in JavaScript to check if the web browser is IE or not? Is there any other way to validate this way ..? Thanks
how to call java script function through java class file
how to call java script function through java class file  how to call jframe in java script
Scrolling in UIWebView
Scrolling in UIWebView  How to make an un-scroll able UIWebView
Call servlet from javascript - JSP-Servlet
Call servlet from javascript  Hi in my application i have jsp that designs view, javascript for validation and servlet that perform business logic , in my jsp i have provided an upload button thet upload single column excel file
Help with javascript function - JSP-Servlet
Help with javascript function  I've got a button in a for loop.Each... is that the function BookSeat() to change the value of the button being clicked to "You.... ----So what should i write in the BookSeat() function that'll accomplish
JavaScript array length function
JavaScript array length function In this Tutorial we want to describe you a code that help you in understanding JavaScript array length function. We are using  JavaScript language as scripting language. The var array instantiate
Null reference error in javascript function?
Null reference error in javascript function?  ?° want to use..., this error doesn't occur. The error comes from tb_show function. My code: function writeCookie(CookieAdi) { var dtGun = 1 var strValue
Fatal error: Call to undefined function session_register() in .php file
Fatal error: Call to undefined function session_register() in .php file  I upgraded the PHP and MySQL and in my application following error is coming: Fatal error: Call to undefined function session_register() in ...php file
Javascript Function - Java Interview Questions
Javascript Function  Hi All, Can anyone please send me a javascript function to validate the Date of birth field...it should check,leap year... in JSP var separator= "/"; var minYear=1900; var maxYear=2500; function
Reload UIWebView
Reload UIWebView  Hi, please tell me how to reload a UIWebView in iPhone application. Thanks.   Reloading UIWebView iPhone SDK [iwebView loadRequest: [NSURLRequest requestWithURL:[NSURL URLWithString:@"http
How I call the function union from the main - Java Interview Questions
How I call the function union from the main  Please, from public static void main(String[] args) I would like to call the function union and I...}, }; //calling the function union : paramtere to pass is mat //how i call
UIWebView in UINavigationController
UIWebView in UINavigationController  I am wondering why application gets slow while push and pop. I have used the UINavigationController in my application. [self.navigationController popViewControllerAnimated:YES
uiwebview fit page
uiwebview fit page  How to fit the page in UIWebView in Xcode. Thanks
Caching UIWebView
on UIWebView that is loading perfectly but my problem is .. it's taking a lots of time to load. Is it possible to caching the loaded file in UIWebView. And if yes
Caching UIWebView
on UIWebView that is loading perfectly but my problem is .. it's taking a lots of time to load. Is it possible to caching the loaded file in UIWebView. And if yes
uiwebview zoom
uiwebview zoom  Hi, I want to zoom UIWebview programmatically. Please provide me code. Thanks   Hi, First you set the "Scales Pages to Fit" property of your webview in interface builder. Then use the following code
How to send UIWebView Title to UINavigationBar
How to send UIWebView Title to UINavigationBar  How can i replace the title of the UINavigationBar to UIWebView Page Title(i.e. javascript title)?   Write the given code into webViewDidFinishLoad method NSString
calling a javascript function by passing multiple values from applet in web application
calling a javascript function by passing multiple values from applet in web application  Hi all, I have a requirement like this, I have to call a javascript function from JApplet by passing 3 values. I am new to Applets
Displaying the values in text fields of a form from a javascript function in jsp
to call a javascript function by passing 3 values from applet. And i have...Displaying the values in text fields of a form from a javascript function... and javascript function must be available in the same web page. Any help
callig jsp file from javascript function - JSP-Servlet
callig jsp file from javascript function  I want to call a jsp file from javascript function. What I want to do is Whenever a user clicks on a form in html, the function should call specified jsp file.The form has no dynamic
JavaScript array length function
JavaScript array length function   ... you in understanding JavaScript array length function. We are using ... object passed as argument  to the function get length ( ). javascript_array
open pdf in uiwebview
open pdf in uiwebview  Hi, How to open pdf in uiwebview? Thanks
UIWebView Activity indicator
UIWebView Activity indicator  Can anyone please explain, how to implement a Activity Indicator on UIWebView in my iPhone/iPad application. Thanks
UIWebView Zoom in and out
UIWebView Zoom in and out  Hi, Can anyone give me the example of tap and zoom in and out the pdf loaded on uiwebview?? Thanks
JavaScript call from flex application
() method is used to call the javascript function. The first argument takes the name...; } A JavaScript call from flex application In flex application, you may have called function defined in action script. Sometimes you may need to call
javascript split function - Design concepts & design patterns
javascript split function  Dear Sir, Thank you very much for all the help so far.Thank you.RoseIndia rocks.Whenever somebody ask me 4 any... use split function?if,yes:How?Pliz help regards Debasis
Clear UIWebView cache iPhone
Clear UIWebView cache iPhone  Hi, In my iPhone application ..i am using a UIWebView to load different URL on it. But i am afraid that it 's... a UIWebView? Thanks
UIWebView zoom not working
UIWebView zoom not working  Hi, I don't know why UIWebView zoom not working? Tell the solution. Thanks   Hi, Open the .xib file and set scalesPageToFit to YES. Thanks
 

 

 

DMCA.com