Link Target in iPhone Based web app - iphone

I am building a web application that is to be run by adding the app to the home screen. Currently it has a list of users, clicking on a user takes you to a detail screen for that user and on that screen is a notes link to take the user to another screen with a grid of notes and a text box to add more notes.
When any links are clicked/tapped, the link is opened in Safari, not the current full screen Safari instance. I tried setting the target of the link to _self, but this had no effect.
Any ideas?

I learned a full screen iPhone webapp can only be a single web page. Any link you try to open will launch Safari instead of replacing the current page. To combat this, I used asp.net postbacks with panels to hide/load/show requested data.

I use target="_webapp" and it works just use for example <a href="http://your.link" target="_webapp"> and it gonna open the link without exit landscape (full screen) i dont know why but with some of my webapps works and sometimes dont.

Related

How to navigate to different pages in a chrome app without creating a new window?

My Chrome app contains two pages A1.html and A2.html. How can i navigate from A1.html to A2.html without creating a new window?
The page A1.html contains 10 div's and A2.html contains a back link to A1.html. My need is to load directly a specific div of A1.html when the back link in A2.html is pressed.
You can't navigate within a Chrome App window (Content Security Policy), although you can navigate to an external browser if you set the target attribute of the <a> element to "_blank". What you have to do, if you really want links to appear to work normally, is intercept the click on the link by setting an event handler and then changing the DOM from within JavaScript.
One easy way to change the DOM from JavaScript if you have an HTML fragment is to use the insertAdjacentHTML API (Google it for documentation).
While this might seem awkward, even limiting, think of a Chrome App as an app, and not a web page. After all, with a native Mac OS X or Windows app, you wouldn't expect to entirely change the UI in a window by simply clicking on a button, right? You'd expect that the app would do that via the native API. Same the Chrome Apps.
Alternatively, you can position a webview in the Chrome App window, and then HTML within the webview works normally, because that really is a "web view."

Admob's Adchoices to open in Safari instead of a webview

I am guessing this is a new type of ad for Admob.
Before, every time I click an ad returned by Admob, it opens the app store or a link in safari. But now, if I click on an ad that has the blue arrow on the right, it just shows a webview with the link. I am wondering if this can be avoided. I want the link to directly open in safari whenever I click the blue arrow. I noticed that the number of clicks for my ads have significantly decreased since this kind of ad appeared. So I'm thinking this may be related to the ad not opening in a browser.
Thank you very much for your help.

Preload WebSite

I am using the iPhone simulator that is part of the SDK to test a jQuery Mobile website. I have the startup of the simulator scripted but once the simulator is up and running, I still have to click on Safari/enter the website URL. Is there a way to preload Safari/website URL through the shell script?
You can do the following... Once you open your webpage via mobile safari, look at the bottom tool bar where you see a set of icons. Click on the centre one "Share" and you get a list of options. Select "Add to home screen" and give it a name when prompted. Now, you will have this page added to the home screen and you can simply open this with a click.

iPhone webClip browser app suggestions

I want do build an webclip browser app. I will display all my webclips in to a scroll view when the user taps on one I want to add that web clip to the iPhone.
How to I tell to the iOS to install that webclip from my app?
Any docs, example, tutorials are welcome.
If by webclip you mean adding a link to a web address to the home screen then you can't do that programatically.
I think only Safari can do this so you would have to open the destination webpage in Safari and instruct the user how to add it to the home screen.
See this for a discussion on the feature. Javascript for "Add to Home Screen" on iPhone?

Adding Icon on desktop of iPhone

I want to place an icon on the iPhone screen form my application, like placing an icon and if i will touch that icon it will do the desired operation, like opening a sound file or an image.
So i want to ask is it possible to place an icon on screen through an application and do some events on it.
Regards,
Vishal
You can't do that. The only icon that will appear on the iPhone home screen will be the icon for your application itself.
Edit:
Expanding on the web shortcut idea suggested by Gene, it might be possible you achieve what you want by having a web short cut using a specific protocol handler to open your app with a web short cut added to the home screen. Take a look at this article:
http://www.mobileorchard.com/apple-approved-iphone-inter-process-communication/
I believe that would still require the user to add the shortcut though, I don't think a third party app can add web shortcuts.
I found it annoying that google maps cannot be page bookmarked onto the home screen. Here is an almost quick solution:
Create a Tiny URL of the target Google Map. SF Bay Area Traffic is http://maps.google.com/maps?hl=en&ie=UTF8&ll=37.55111,-122.121277&spn=0.810034,1.182404&z=10&layer=t
Mail yourself the Tiny URL.
Select the URL in the email application.
Before Safari realizes that it is a Google Map url, touch the x on the url line to cancel the transfer to the Google Map App.
Touch the + at the bottom of Safari and touch "Add to Home Screen"
Name it appropriately and, there you have it, a Google Map entry on your home screen.
Andynormancx is correct. The only exception to this rule (that I know of) is a web shortcut -- within Mobile Safari, you can select "add to home screen", and a shortcut to the bookmarked page will appear on Springboard. The icon is a partial screenshot of the web page.
I don't know if this would be useful to you, though I suppose you could bookmark a link to a sound file or image.
What you can do is create an application and under ApplicationDidLoad in your ApplicationViewController.h
You would type in your code. (If you don't have the SDK, then don't post the question with the tags iPhone-SDK and Cocoa.)
In addition to Gene's answer, you may want to set the following meta tags:
<link rel="apple-touch-icon" href="https://path/to/icon.png" />
<meta name="apple-mobile-web-app-capable" content="yes" />