I doing one simple task in jQuery alpha 4. It run in browser but when I run in WP7 emulator, it shows only white screen? can any one suggest me how to run in WP7?
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Alpha 4 test</title>
<!-- alpha 4 for jQuery mobile -->
<link rel="stylesheet" href="script/jquery.mobile-1.0a4.min.css" />
<script type="text/javascript" src="script/jquery-1.5.min.js"></script>
<script type="text/javascript" src="script/jquery.mobile-1.0a4.min.js"></script>
<script type="text/javascript">
function callpage2()
{
$.mobile.changePage("#detailpage","slide",false,false);
}
</script>
</head>
<body id="callweb">
<!-- /Page Starts -->
<div data-role="page" id="searchpage">
<!-- /header Starts-->
<div data-role="header" data-backbtn="false">
<center><font size="2"><h3>Saxo Tech</h3></font></center>
</div>
<!-- /header Ends -->
<!--Content Begins-->
<center>
<div data-role="content" id="content">
First page
Using ID
<button onclick="callpage2()"> Using button (mobile changepage)</button>
<ul data-role="listview" data-inset="true" data-theme="e">
<li><img src="script/images/11.jpg" class="ui-li-thumb" /> <a style="margin-left:1em;">one</a></li>
<li> <img src="script/images/globe.jpg" class="ui-li-thumb" /><a style="margin-left:1em;">two</a></li>
</ul>
</div>
</center>
<!--Content Ends-->
</div>
<!-- Page End-->
<!-- Detail Page Starts -->
<div data-role="page" id="detailpage">
<!-- /header Starts-->
<div data-role="header">
<center><font size="2"><h3>Saxo Tech</h3></font></center>
Back
</div>
<!-- /header Ends -->
<!--Content Begins-->
<center>
<div data-role="content" id="content">
second page
</div>
</center>
<!--Content Ends-->
</div>
<!--Detail Page End-->
</body>
</html>
The debug capabilities on the mobile browser are not very advanced.
The best way to debug this is to try using the desktop browser instead. Does this example run on IE7 (or IE9 running in compatible mode)? Get it working there first, then move it across to the mobile UI.
I would suggest to used the CDN instead your local files for invoking jQuery and jQMobile just to start.
change this
<link rel="stylesheet" href="script/jquery.mobile-1.0a4.min.css" />
<script type="text/javascript" src="script/jquery-1.5.min.js"></script>
<script type="text/javascript" src="script/jquery.mobile-1.0a4.min.js"></script>
into this
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a4/jquery.mobile-1.0a4.min.css" />
<script src="http://code.jquery.com/jquery-1.5.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0a4/jquery.mobile-1.0a4.min.js"></script>
I have run into this same issue before.
For me it was an issue with my html syntax and I think is could be a similar issue here (It seems JQM under WP7 is very picky about its HTML)
I'd start with the centre tags around the content divs, either get rid of them or move them inside. Maybe even the font tags and use CSS classes.
Related
I am developing a Spring Boot application and using Thymeleaf Templating. I am new to this and need a little guidance. I have a index.html file which is the main view which should be displayed. Inside the index.html file i have two fragments, a header and a footer which display as well. What i am having trouble with is inserting more fragments into the index.html file. I want to insert another fragment which displays a navigation top bar as well as a second fragment that displays a side navigation menu. I am looking to include the topnavbar right below the header fragment and the side nav menu on the left side of screen. How do i go about doing this? Thank you.
Index.html
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">
<head lang="en">
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/css/bootstrap.min.css" integrity="sha384-Zug+QiDoJOrZ5t4lssLdxGhVrurbmBWopoEl+M6BdEfwnCJZtKxi1KgxUyJq13dy" crossorigin="anonymous"/>
<link rel="stylesheet" href="../static/css/main.css"
th:href="#{css/main.css}" media="screen"/>
<title>Spring Boot | Web Application</title>
</head>
<body>
<div class="container">
<div class="row" th:include="header :: banner"></div>
<div class="row">
<div class="col-sm-3"><hr /></div>
<div class="col-sm-9 text-center">col-sm-8</div>
</div>
<div class="row">
<div class="col-sm-12"><hr /></div>
</div>
<div class="row" th:include="footer :: copy"></div>
</div>
<!-- jQuery, Popper.js, Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/js/bootstrap.min.js" integrity="sha384-a5N7Y/aK3qNeh15eJKGWxsqtnX/wWdSZSKp+81YjTmS15nvnvxKHuzaWwXHDli+4" crossorigin="anonymous"></script>
</body>
</html>
I am generating reports using DOMPDF in codeigniter. This pdf have 10 pages in which 3 pages have yellow background (Page #2, #5 and #8 and entire page bgcolor needs to be yellow without margin or spacing) rest pages background color is white.
Also, i am using DOMPDF's html5 parser by setting "DOMPDF_ENABLE_HTML5PARSER" config as true. This is because my report html's contains html5 tags like footer.
I googled this and found one solution as to put each page in separate "body" tag but generated output have all pages in yellow background.
Below is my html template:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Report</title>
<link rel="stylesheet" href="css/reports/styles.css" />
</head>
<!-- Page #1 -->
<body>
<div>
<div class="wrapper">
<h1>Heading</h1>
<ul class="index">
<li>2. report 1</li>
<li>5. report 2</li>
<li>8. report 3</li>
</ul>
</div>
</div>
</body>
<!-- Page #2 -->
<body style="background-color: #f2ab02">
<div>
<div class="wrapper">
<h1>Report 1: Analysis & Results</h1>
<img src="/img/reports/human-face.png" class="imglogo" />
</div>
</div>
</body>
<!-- Page #3 -->
<body>
<div>
<h1>Report 1: (1/2)</h1>
<table>...</table>
<footer>
<img src="/img/reports/logo.png" class="footer-logo" />
<div class="page_number">3</div>
</footer>
</div>
</body>
<!-- Page #4 -->
<body>
<div>
<h1>Report 1: (2/2)</h1>
<table>...</table>
<footer>
<img src="/img/reports/logo.png" class="footer-logo" />
<div class="page_number">4</div>
</footer>
</div>
</body>
<!-- Page #5 -->
<body style="background-color: #f2ab02">
<div>
<div class="wrapper">
<h1>Report 2: Analysis & Results</h1>
<img src="/img/reports/human-face.png" class="imglogo" />
</div>
</div>
</body>
<!-- Page #6 -->
<body>
<div>
<h1>Report 2: (1/2)</h1>
<table>...</table>
<footer>
<img src="/img/reports/logo.png" class="footer-logo" />
<div class="page_number">6</div>
</footer>
</div>
</body>
<!-- Page #7 -->
<body>
<div>
<h1>Report 2: (2/2)</h1>
<table>...</table>
<footer>
<img src="/img/reports/logo.png" class="footer-logo" />
<div class="page_number">7</div>
</footer>
</div>
</body>
<!-- Page #8 -->
<body style="background-color: #f2ab02">
<div>
<h1>Report 3: Analysis & Results</h1>
<img src="/img/reports/human-face.png" class="imglogo" />
</div>
</body>
<!-- Page #9 -->
<body>
<div>
<h1>Report 3: (1/2)</h1>
<table>...</table>
<footer>
<img src="/img/reports/logo.png" class="footer-logo" />
<div class="page_number">9</div>
</footer>
</div>
</body>
<!-- Page #10 -->
<body>
<div>
<h1>Report 3: (2/2)</h1>
<table>...</table>
<footer>
<img src="/img/reports/logo.png" class="footer-logo" />
<div class="page_number">10</div>
</footer>
</div>
</body>
</html>
Any help will be appreciated.
I can't say that I would recommend this method, but it might work if you disable the HTML5 parser. The main use of the HTML5 parser in dompdf is to correct syntactical errors. Multiple BODY elements are not permitted and so after passing through the HTML5 parser the multiple body elements will be merged into a single element.
A newly installed visual studio 2010. Then i tried to add bootstrap for better design but its not working
Here is my code
<%# Master Language="C#" AutoEventWireup="true" CodeBehind="Main.master.cs" Inherits="mySample.Main" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<asp:ContentPlaceHolder ID="head" runat="server">
<link href="contents/css/bootstrap-theme.min.css" rel="stylesheet" type="text/css" />
<link href="contents/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div class="navbar navbar-fixed-top navbar-default" role="navigation" >
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Job Order System</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="active">Home</li>
<li>Closed Request</li>
</ul>
</div>
</div>
</div>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</form>
<script type="text/javascript" src="<%= Page.ResolveUrl("~/script/jquery-2.1.0.min.js") %>"></script>
<script type="text/javascript" src="<%= Page.ResolveUrl("~/script/bootstrap.min.js") %>"></script>
</body>
</html>
It only display a normal list
Please help me solving this kind of problem. Thank you so much
I see 2 potential problems:
You're using a relative URI in the <link /> elements, this won't be a problem if every page is in the root of your website, but it's good practice to make these Application-root-relative URIs. Add runat="server" to the element and begin the href with ~/ and ASP.NET will automatically give it a correct URI
You've put the <link /> inside <asp:ContentPlaceHolder elements, which means they're the "default content" of the placeholders. If any of your pages set content for that placeholder then the default content (i.e. your bootstrap links) will be removed.
i'm a web devoper from Italy...I have a problem with loading with href
example:
i have one.html with this code
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta names="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<title>dkrMobile</title>
<!--caricamento librerie-->
<script src="js/jquery-1.9.1.min.js"></script>
<script src="js/jquery.mobile-1.3.1.min.js"></script>
<link rel="stylesheet" href="css/jquery.mobile-1.3.1.min.css">
</head>
<body>
<!-- LOGIN -->
<div data-role="page" id="loginPage">
<div data-role="content">
<div style=" text-align:center">
<img style="width: 70%;" src="http://www.laboncloud.it/dkrmobile/css/images/logdkr.png">
</div>
<form action="#pageFile">
<div data-role="fieldcontain">
<label for="userNameLogin">
Username
</label>
<input name="" id="userNameLogin" placeholder="" value="" type="text">
</div>
<div data-role="fieldcontain">
<label for="passwordLogin">
Password
</label>
<input name="" id="passwordLogin" placeholder="" value="" type="password">
</div>
<a data-role="button" data-theme="a" data-transition="fade" href="two.html" data-prefetch="trues">
Login
</a>
</form>
</div>
</div>
</body>
</html>
and the two.html with this code:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta names="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<title>dkrMobile</title>
<!--caricamento librerie-->
<script src="js/jquery-1.9.1.min.js"></script>
<script src="js/jquery.mobile-1.3.1.min.js"></script>
<link rel="stylesheet" href="css/jquery.mobile-1.3.1.min.css">
<link rel="stylesheet" href="css/jqm-icon-pack-fa.css">
<script type="text/javascript" src="js/tolito-1.0.5.min.js"></script>
<link rel="stylesheet" type="text/css" href="css/tolito-1.0.5.min.css" />
<!--css userinterface-->
<link rel="stylesheet" href="css/ui.css" />
</head>
<body>
<div data-role="page" id="loadingPage">
<div data-role="content">
<h1>caricamento di tutti i contenuti in corso</h1>
<a data-role="button" data-theme="a" data-transition="fade" href="#pageFile">skip</a>
</div>
</div>
<div data-role="page" id="pageFile">
<div data-role="content">
<h1>dueeee</h1>
</div>
</div>
<!-- FILE-->
</body>
</html>
now if tap on login - the two.html will no be loaded.
want a demo?
here the demo
if I click on skip in two.html dont show nothing (if I refresh the page it start work).
the only way is data-ajax="false" ? why?
This is not an error. To understand this problem you must understand how jQuery Mobile works.
Multi HTML template can't be mixed with multi page template. For example when working with several HTML pages, only first one can have more then one page. When jQuery Mobile loads other HTML files it will strip HEAD (we dont need it because first HTML HEAD content is already loaded into the DOM) and it will load ONLY first page it can find in a file, every other page will be discarded.
data-prefetch will not help you here. Also you are initializing it incorrectly, data-prefetch attribute don't have a value, it is just data-prefetch, example:
<a data-role="button" data-theme="a" data-transition="fade" href="two.html" data-prefetch>Login</a>
If you want to find out more how jQuery Mobile handles multiple HTML and multiple page templates or what are they take a look at this ARTICLE or THIS one. To be transparent they are my personal blog articles. Everything you need to know can be found there.
Basically solution to your problem would be to have all pages inside a single HTML file, or you should brake two.html into two separate HTML files. you decide what is a best solution for you.
I am trying to use jQuery Mobile with the Phonegap Windows Phone template.
The problem I am having is that the list item icons will not display.
My code is below:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>test</title>
<link rel="stylesheet" href="jquery.mobile-1.0b2.css" />
<link rel="stylesheet" href="site.css" />
<script type="text/javascript" charset="utf-8" src="jquery.js"></script>
<script type="text/javascript">
$(document).bind("mobileinit", function () {
// As of Beta 2, jQuery Mobile's Ajax navigation does not work in all cases (e.g.,
// when navigating from a mobile to a non-mobile page, or when clicking "back"
// after a form post), hence disabling it.
$.mobile.ajaxEnabled = false;
});
</script>
<script type="text/javascript" charset="utf-8" src="jquery.mobile-1.0b2.min.js"></script>
<script type="text/javascript" charset="utf-8" src="phonegap-1.3.0.js"></script>
</head>
<body>
<!-- Home Page -->
<div data-role="page" id="home" data-theme="b">
<div data-role="header">
<h1>Home Page</h1>
</div>
<div data-role="content">
<ul data-role="listview" data-inset="true">
<li data-role="list-divider">Map</li>
<li>Map page</li>
</ul>
</div>
</div>
<!-- Home Page End -->
</body>
</html>
If I browse the files in Chrome or Firefox the icons are visible. It only fails in Windows Phone emulator.
Has anyone found a solution?
Just found the answer here:
jquery mobile on Windows phone 7 images not loading
Doh!
Just need to set the build action of the icons to Content