• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Run Javascript Function From Objective-C.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Run Javascript Function From Objective-C.


  • Subject: Re: Run Javascript Function From Objective-C.
  • From: Izidor Jerebic <email@hidden>
  • Date: Mon, 28 Sep 2009 14:21:04 +0200


On 28.9.2009, at 14:00, Philip Juel Borges wrote:


I have this javascript function in my test.html file which is loaded in the WebView:


function goToPage(mybox) {
window.location ='#' + mybox.value;
}



BTW the function as written above will not work - the parameter you are passing from Cocoa is not field, but already value string, so you need to change the function accordingly...

Okay then. How would I go about doing that? That isn't too clear to me.


--Philip


I'm sorry, I was not very clear.

The cocoa methods I suggested pass the value as the parameter, so your javascript function should look like this:

function goToPage( value ) {
  window.location ='#' + value;
}


And I'm still not sure this method of scrolling works, but this code should at least get your cocoa value into your javascript function.


izidor

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Run Javascript Function From Objective-C. (From: Philip Juel Borges <email@hidden>)
 >Re: Run Javascript Function From Objective-C. (From: Izidor Jerebic <email@hidden>)
 >Re: Run Javascript Function From Objective-C. (From: Izidor Jerebic <email@hidden>)

  • Prev by Date: Re: One-liner to check existence of image
  • Next by Date: Re: Creating a radar sweep effect
  • Previous by thread: Re: Run Javascript Function From Objective-C.
  • Next by thread: NSTokenField token color
  • Index(es):
    • Date
    • Thread