facebook

Open new Window or Share

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #314243 Reply

    Molx
    Member

    Hi,

    I’ve been trying to add a Tweet/Facebook Share button to my app, but I can’t get it done. I’ve read that javascript window.open(url) do not work on Standalone pages.

    Is there any manner to open a Safari window (e.g. to use window.open(‘http://twitter.com/home?status=’+tweet)), or to connect to the social networks?

    Thanks.

    #314300 Reply

    support-michael
    Keymaster

    Hi,

    I asked someone here that has bigger web-nuts than me to help research this. I’ll let you know as soon as I know something.

    Wayne
    Genuitec Mobile Team

    #314303 Reply

    support-remi
    Member

    Yes, you can just create a link as _blank (new window) using this link:
    http://www.facebook.com/sharer.php?u=http://www.genuitec.com
    Just replace “u” value with the needed URL

    Same for Twitter, but remember that a tweet is only 140 chars.
    url value will be auto shorten, text value can be everything (including links). Note that Twitter sharer also provides an URL shorterer inside its sharer window
    http://twitter.com/share?text=Google&url=http://www.genuitec.com

    Hope this help!

    R.

    #314307 Reply

    Molx
    Member

    Thanks for your answer Remi.

    But is it possible to add html properties to the link paremeter of the button? How?

    It if isn’t, what’s the solution? Change the html after generated? That wouldn’t be practical considering I would have to change it everytime I change the design.

    I would suggest that you add the target property just above the link for buttons and links, I supposed it wouldn’t be much trouble.

    #314327 Reply

    support-michael
    Keymaster

    Thanks Remi,

    I experimented with this approach for opening a separate safari window. I set the Link property to this snippet of javascript:

    javascript:window.open(‘myurlhere’,’_blank)

    the real value I tried is:

    javascript:window.open(‘http://www.facebook.com/sharer.php?u=http://genuitec.com’,’_blank)

    Wayne
    Genuitec Mobile Team

    #314376 Reply

    Molx
    Member

    Thx wayne, it worked (I just had to ad the ‘ that you forgot after the _blank!)

    I also wanted to add a variable value to the post, and I figured out how to do it by myself. Here is the code I used:

    javascript:window.open(‘http://twitter.com/?status=My variable value is ‘+myvariable+’ ,right?’,’_blank’)
    javascript:window.open(‘http://www.facebook.com/connect/prompt_feed.php?&message=My variable value is ‘+myvariable+’ ,right?’,’_blank’)

    I used ‘?status=’ and ‘/connect/prompt_feed.php?&message=’ cause I don’t want to send links.

    Both seem to be working fine, the only issue I had was that if I tried to use textbox.value as the variable the link wouldn’t open, so I created a variable with the value.

    If you wanna see what I’ve been working on (just for testing, as long as it stays uploaded):
    http://mobioneappsync.appspot.com:80/get/166ec1f70826408dac13a0ffc5e1ffb8/main.html

    #314630 Reply

    support-remi
    Member

    Hiu Moix,

    Did you found a solution? I think a form.formname.inputname.value could work, but could be tricky with multiple lines or special chars. The only thing to get is the name element value given by codegen to your form & input

    R.

    #320076 Reply

    mezo
    Member

    Thanks for the code, however it didn’t work with at all, either from home screen or calling the app link within safari.
    I badly need this option to work, any help please will be highly appriciated.

    #320327 Reply

    This message has not been recovered.

    #320366 Reply

    support-michael
    Keymaster

    This message has not been recovered.

Viewing 10 posts - 1 through 10 (of 10 total)
Reply To: Open new Window or Share

You must be logged in to post in the forum log in