Correct way to submit a phonegap/jQM form. - forms

very new at this. Could someone tell me what is the best method of submitting a form when using phonegap and JMQ? What I want to be able to do is passing the form data to a php file and then having the results passed back into app so that the user isnt directly accessing the php file at any point.
I found the following page link which basically does what I want but I keep getting "Origin null is not allowed by Access-Control-Allow-Origin" when testing out the code. So I'm guessing this will only work if the app is located on a server also?
Any happy would be great. thank <3

To test your solution on the computer you need to launch chrome from the terminal with the argument --disable-web-security. See this answer: Disable same origin policy in Chrome
In your Phonegap application you add a line of code to your config.xml in the www-folder: <access origin="*.yourdomain.com" />. Build, and you are now allowed to request all domains and subdomains from yourdomain.com. For more details on whitelisting see http://docs.phonegap.com/en/3.0.0/guide_appdev_whitelist_index.md.html#Domain%20Whitelist%20Guide

You are not able to make post through the local files, so Yes, you need to have it running in a Web Server.
But if you deploy your application, it should work either in a emulator or in your device.

Related

Error: 404 The page you're looking for could not be found (gitlab). How to resolve it?

Let's say I have some website with the name website.eu. When I deploy it and try to get access to a page online like this website.eu/about I catch the error:
"404 The page you're looking for could not be found. The resource that you are attempting to access does not exist or you don't have the necessary permissions to view it"
When I click on the link that brings me a website.eu/about it works well, but trying to type that URL in the input field it fails.
Everything works fine locally.
The project is developed using Vue3.
The project is no GitLab.
If someone helps I would appreciate it.
Hard to tell without seeing the code, but my guess is your router setup uses the web history mode, which relies on the server to have certain settings applied.
I believe switching to hash mode (while adding # to the routes) will work.
Alternatively, you can update your server to support redirects to have the html mode work.
example server configurations

merge large existing web app into Sailjs site

I'm trying to merge large existing web app into sails.js. so I moved the folders into assets and build a custom route , 'GET /': '/assets/client/launch.html' and get 404 when I point my browser to http://localhost:1337/ as the / is correctly redirected to http://localhost:1337/assets/client/launch.html which produces the 404.
Now the file exists in the folder assets/client (and in .tmp), so I am thinking the Sails router is getting in the way.
I would leave the client (70K lines of JS) that generates all the UI dynamically and sailjs server that provides authentication separate and enable CORS but my customer wants client packaged with server. This type of operation is simple in frameworks like ASP.NET MVC but am wondering if Sails is up to the task.
Well, If everything you tried did not work out. There might be another solution ,
First of all since you are talking about sails app I am assuming other bundle must be sails as well ,
So here is what you do-
Change the port for another app that you want to attach to this.
Second whenever you want to go to page on another app simply redirect the client to another port ie
in html or esp put a href tag with different port.
<a href="localhost:PORT/route_to_file">
</a>
I got it working by placing my app into assets where we need to launch from assets/client/index.html as there would be too many dependencies to change. As I said above could not just add a route as Sails must getting in the way. However as in Chapter 3.2.2 of Sails in Action I generated a static asset npm install sails-generate-static --save. then I redirected to assets/client/index.html. As an aside that book is great and would highly recommend it.

Failed to execute 'replaceState' on 'History': A history state object with URL

We have faced this type of problem.We are Developing phonegap app.We don't changed any code.But unfortunately my eclipse stop.And then we changed project location.then we open html page in browser.We got error like this
Please guide to us.
You can test your app inside a web server, that solved my problem, or you can simply delete "history.replaceState()" in your jquery.mobile.js file, if you don't use the browser history in your mobile app
Waiting for chrome developers to fix this issue from the last update.

Facebook SDK for .NET - Security Warning Issue

everyone. Today I encounter the following message in my Windows Phone App:
Success
SECURITY WARNING: Please treat the URL above as you would your password and do not share it with anyone.
This happens when my users Login through the Web Browser Control, which get the Login URL from the GetLoginUrl method from the Facebook SDK for .net. This problem is not only happening in my Apps, I've seen users from other Apps having the same problem.
Anyone found a solution to this?
I'm running this SDK in my PictureWeather (Windows Phone 7 & Windows Phone 8) and Picture2Cams (Windows Phone 8) Apps.
Had the same problem. In my app I changed this line:
parameters["redirect_uri"] = "https://www.facebook.com/connect/login_success.html";
To this line:
parameters["redirect_uri"] = "https://m.facebook.com/connect/login_success.html";
And it works now.
Had the same problem on our WP8 app using the Facebook SDK for Windows Phone (http://facebooksdk.net/docs/phone/) and the indicated solution with changing the redirect URL also worked for us.
Thanks for submitting this solution.
I ran into this problem, myself, and did a bit of digging to get to the root of the issue. The problem seems to spring from some unknown (to me, anyway) change on Facebook's side, where previously the authentication response URL was in the form
https://www.facebook.com/connect/login_success.html#access_token= ...
for some reason it now comes back from the login flow as
https://www.facebook.com/connect/login_success.html#?access_token= ...
The code in FacebookSDK.NET does a comparison in line 104 of LoginPage.xaml.cs with a simple Uri equality test
if (e.Uri == WebAuthenticationBroker.EndUri)
which fails to return true when the question mark appears in the middle. I expect Facebook will correct this on their end just because too much stuff breaks, but in the meantime a pretty clean fix is to get the FacebookClient sources from GIT instead of NuGet and change the comparison to this
UriBuilder clean = new UriBuilder(e.Uri);
clean.Query = "";
if (clean.Uri == WebAuthenticationBroker.EndUri)
The code will then run just fine, but this is seems ultimately to be Facebook's bug when checking the documentation on their developer site.
I hope this helps some others, I signed up for Stackoverflow just to make this post. :)
Use latest facebook sdk for windows phone. This issue got resolved in latest sdk. I am using Facebook.Client 0.8.2-alpha and its working great. I followed http://nuget.org/packages/Facebook.Client and http://facebooksdk.net/docs/phone/controls/login-ui-control
I guess the only way he did this was by downloading both projects from their official Github (Facebook and Facebook.Client) and reference them in your app instead of using the DLL that you can get from Nuget.
With both projects in hand, you can change this parameters on the Facebook.Client Project in the file FacebookSessionClient. Then build all the project and run.
However this solution didnt work for me too.

How can I make dokuwiki shown as PC mode not mobile mode?

I have installed dokuwiki to my server.
It shows in mobile mode when I access to it with Android or iPhone.
But I want to show it as PC mode.
How can I?
Which template are you using?
If it's the default "dokuwiki" template, simply remove the line with css/mobile.css from the style.ini file in ./lib/tpl/dokuwiki/.
Dokuwiki's API let determine if the client is mobile. Then it's up to the template to use this information or not.
You could try grep -rn ismobile . on your template code to see how it is used.
Ideally I would have added a comment to ask which template you use, but I'm afraid I don't have enough reputation to leave comments yet.