I'm having some difficulty getting a Google map to appear on my application within the jQuery Mobile framework.
The way it's set up is that I have my main landing page (default.aspx). On that, I have a link to a menu page (MapsMenu.aspx), and from there links to a set of maps (MapDisplay.aspx).
If, on the link on the MapsMenu.aspx page, I set data-ajax="false" than the map will load after jumping out of the framework and onto a new browser page. This is not ideal.
If I remove the data-ajax="false" attribute on the link, then the MapDisplay.aspx page loads, but the map loading method is not triggered. The code on the MapDisplay.aspx page is below:
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> <script type="text/javascript" src="http://j.maxmind.com/app/geoip.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.js"></script> <link href="http://code.google.com/apis/maps/documentation/javascript/examples/default.css" rel="stylesheet" type="text/css" /> <script src="MapOperations.js" type="text/javascript"></script> <script type="text/javascript"> //Google Maps globals: var directionRenderer; var directionsService = new google.maps.DirectionsService(); var map; $(document).ready(function () { alert("Test"); InitialiseMap(); var loc = $('#hfLoc').val(); SetupMap(loc); }); </script>
The jQuery doesn't seem to be firing at all, as the alert("Test") is not being triggered. Am I missing something?
I am using ASP.NET Forms Authentication for my mobile app site. The login process works fine, but I am having a slight issue with the logout.
The logout method is a server side method in a .asmx file in the project. To call it, I'm using the following code:
function SignUserOut() {
$.ajax({ type:
"POST", url: "Services/LogOutService.asmx/LogUserOut", data: "", contentType: "application/json; charset=utf-8", dataType: "json", success: function (msg) { window.location.replace("default.aspx"); }, error: function (x, e) { alert("The call to the server side failed. " + x.responseText); } }); }
The logout process seems to work, however I am getting a brief error 'Error Loading Page' after I click the logout button. This only lasts a second or two before the page refreshes with the logout complete.
What's strange is that this only happens sometimes. Other times, it works perfectly.
I know it's a bit vague, but can anyone hazard a guess as to what the problem might be?
I currently have a master page and a default page on my mobile development. The default page being a content page of the master.
On the default page, I have an asp.net asp:button control that submits a login authentication. This in itself work fine.
However, what I'd like to happen is that when a user clicks the GO button on the virtual keyboard on an iPhone or iPad, it triggers the asp:button control. At the moment, if I click go without completing all the login fields (username and password) it triggers the asp.net validation controls. However, when the fields are full, the GO button doesn't seem to do anything.
Hi, I'm not sure if this is possible, based on what little I currently know.
I currently have a back button on my application, using the data-rel="back" function, but what I really need is a button that takes me back to the home page as well.
This would need to be done using the page transitions, and not breaking out of the page history cycle. Essentially, I need it to cycle back to the first item in the page history - the base URL (default.aspx").
Because I use numerous other aspx pages, I can't simply use the link tag to display a home 'div'.
I'm quite new to both jQuery and the mobile framework, so apologies if this is a rookie question.
I am in the process of creating s site using the framework, using the Ajax transitions to move between pages. However, when I put and Javascript or jQuery functions on my sub-pages, they don't work (object not found etc..).
I've noticed that this is because the Ajax functionality is not loading the header content on each page, and so it WILL work if I leave all my functions on the default page of the site.
This is not ideal, as I'm concerned that loading all the Javascript for the entire site when the system loads will reduce loading time. I'd like to be able to load only the Javascript/jQuery I need for each page I visit.
I've come across a small problem on my mobile development. Hopefully someone can point me in the right direction - I'm fairly new to the framework.
I've created a default.aspx home page, which contains a forms authentication login form. On it's own, this form works as expected. I should point out that the form is an ASP.NET form, rather than jQuery. As far as I can tell, this is necessary - I couldn't get it to work using a JSON call.
On the page, I also have links to other pages within subdirectories. For example:
The page transitions seem to work OK, however if I click on the link to go to the catering page, and then click the back button and then try to submit the login form on the default.aspx page, I get a 404 error with the page URL looking for: CateringMenu/Default.aspx.
I know that I could disable the page transition animation with data-ajax=false on the back button, but I really want to keep the page transition animation. Also, if I use data-ajax=false, I've noticed that it brings back the address bar on the page on my mobile, which I disabled using: