We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to load the online and offline page content using Mobile JS?

You can load online and offline page content in Mobile JS framework. The following methods help you achieve this.

For Offline Content:

You can load the offline page content in two ways, that is by using with Ajax call or without Ajax call, that is explained as follows.

Option 1: With Ajax Call

To load the offline content with Ajax call, you have to set the page url as the second parameter of the App.pageTransfer method as shown in the following code example. Here it’s given as ajax.html for JS and /home/ajax for MVC.

HTML

CSHTML

Option 2: Without Ajax Call

To load the offline content without Ajax call, you can set the page url as href in the anchor link tag and set data-ej-appajax attribute as False. Here it is given as navpage.html for JS and /home/navpage for MVC. Refer to the following code example.

Note: When you are doing this, you cannot achieve transition effect while transferring from one page to another, since the transition effect is applicable only for Ajax content loading.

HTML

CSHTML

For online content:

You cannot load the online page content by using the transferPage API, because it is completely handled with AJAX. However, you can achieve this by disabling the ajax feature with the anchor link while using the MobileJS source files.

To load the online content without Ajax call, you can set the page url as href in the anchor link tag and set the data-ej-appajax attribute as False. Here it is given as http://www.google.com. Refer to the following code example.

Note: As already mentioned in the method for offline content without Ajax call, you cannot achieve transition effect while transferring from one page to another, as it is applicable only for Ajax content loading.

HTML

CSHTML

<div align="center" style="top: 20px; position: relative;">

<a id="btn" data-ej-appajax="false" href="http://www.google.com">Go to Google page</a>

</div>

Article ID: Published Date: Last Revised Date: Platform: Control:
4959 05/23/2015 05/23/2015 JavaScript General
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon