navigate within index.html using cordova and phonegap - javascript

I have a cordova/phonegap project and I want to navigate in the same index.html but give the impression to the user that he opened a new page? (Without ionic framework)
I put the following code in index.html but it does not give that impression:
<div id="page_01">
Press for Next step>
</div>
<div id="page_02">
<p>New page for the user but it is in the same index.html</p>
</div>

Related

Adding a marketo form to github

I need to embed a marketo form onto a github page, essentially host it there, then iframe it into another piece of software I'm using. The iframing in afterwards is striaght forward as the software does that. But I cant work out how to actually embed it on github.
Go to the Marketo form
Grab the form embed code
Grab the munchkin tracking code too. Not 100% essential but needed if you want web page tracking on the Github page the form will live on.
Drop code in a Div section.
From my code example you could replace 132 (with your actual form ID)
And replace 111-AAA-111 wit your Munchkin ID.
Example
<div data-role="page" id="page_1">
<div data-role="header">
<h1>Test form. Embedded</h1>
</div>
<div data-role="main" class="ui-content">
<script src="//app-abj.marketo.com/js/forms2/js/forms2.min.js"></script>
<form id="mktoForm_123"></form>
<script>MktoForms2.loadForm("//app-abj.marketo.com", "111-AAA-111", 123);</script>
</div>
<div data-role="footer">
<h1>Footer: text</h1>
</div>
</div>

Webapp seems to be getting redirected

I am working on a webapp for a school project that uses JQuery, along with some of my own JS code. There seems to be a strange tendancy across the site for the browser (regardless of if I use firefox or chrome) to be redirected back to the main page (index.html).
For example, I have a page called create.html which includes JQuery and has a button defined as follows:
<button onclick="addEmail()"type="create" class="button button-block"/>+</button>
the addEmail function does not include any code to redirect or otherwise change the page. Even when the onclick attribute is removed entirely the browser ends up back on the index.html page once the button is clicked. The index.html page also does not render correctly when it is loaded in this manner. We have the following includes in the create.html file:
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
<script src="js/create.js"></script>
The files are hosted on an apache server as well.
Thanks,
Ryan

prevent opening safari in cordova webview links

In my cordova app I just open an external website as the content src:
<content src="http://example.com" />
When linking inside my website with normal links:
<a href='/internal.html' />
it opens external safari browser and not staying inside the app.
I've managed to achieve staying inside the app by using this code:
<a href='javascript:void(0)' onclick='window.open("/internal.html","_self")'></a>
Is there a way to stay HTML native without javascript and link inside the app?

Web page in PhoneGap project

Hello everybody !
I have a Phonegap projet with the Ionic Framework and AngularJS.
I want to show a web page in my app but keep the navigation bar too.
The nav bar is a Ionic component ion-nav-view.
Here is my code :
<ion-view title="Web page">
<ion-content class="has-header">
<!-- suppose to show the web page here -->
</ion-content>
</ion-view>
I tried to use <iframe> but I'm not able to scroll on the web page, tried to use <object>, same problem.
Any help please?
Thanks
Had the same issue. Think this is an issue with whitespace between css blocks. I removed the whitespace between the tags it worked.

Using "Web Application Toolkit for Mobile Web Applications" for iPhone

I am using the Web Application Toolkit for Mobile Web Applications to develop a simple website (which allows to update the users) for Windows 7 Mobile and iPhone using asp.net MVC.
I am using the ibbdemo as simulator to test for iPhone.
I have been facing few issues with this.
Javascript/Jquery is not working (I have tried to set the textbox value in document.ready in a plain page with just a textbox)
Form Collection of radio button returns all the values in comma separated, not only the selected one.
Edit:
I am trying to do the following after the admin logs in to website:
Show links like Active Users and Inactive Users(Main/Index).
Once the Admin clicks the Active Users link, then the list of active users will be shown (User/Active)
On Clicking the Name of the user, the page to update the User details like Name, Sex, Email,... will be shown (User/Detail)
The javascript works till the 1st step, from 2nd step, it doesn't do anything. I have tried adding a dummy textbox in (Main/Index) page and set the value in document.ready, it worked. But when i do the same in (User/Active) or (User/Detail), the javascript/jquery doesn't seem to work. To Test, I have copied the first page content to all of them, but still it works in first page but not in rest. I am puzzled with this issue.
Here is the html that looks in (Main/Index):
<%# Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Mobile/iPhone/Site.Master"
Inherits="System.Web.Mvc.ViewPage" %>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div class="toolbar">
<h1 id="pageTitle">
</h1>
<a id="backButton" class="button" href="#"></a>
</div>
<form id="dashboardForm" action="Main/Index" method="get" title="Dashboard" class="panel"
selected="true">
<fieldset>
<div class="row">
<label>
Dummy:</label>
<%= Html.TextBox("dummyText") %>
</div>
<div class="row">
<label>
Users: Add</label>
</div>
<div class="row">
Active Users Inactive Users
</div>
</fieldset>
</form>
<script type="text/javascript" language="javascript">
$(function() {
$("#dummyText").val('test');
});
</script>
</asp:Content>
Is there any work around or did anyone face the same problem and found a solution for this?
Or is there any another toolikit for developing mobile apps using asp.net MVC, please suggest
There is a mode in Safari(the browser from Apple), that lets you emulate Mobile Safari, the browser of the iPhone.
In the menus, find Develop -> User Agent and choose the browser you want to emulate.

Categories

Resources