I have a work assignment, and I don't have any alternative; I have to use the qooxdoo framework.
How can I do a query with MySQL and PHP using this framework? In the examples present in the site, all tables use random values or JSON values, but in this case, I need PHP.
I know that I can't use PHP code inside a JavaScript file, so is Ajax the unique solution?
How I can solve that?
You write a PHP RPC service which provides the data to your qooxdoo application. You can find more input on this in PHP RPC (qooxdoo documentation).
Another way is to create your own transport, for example, use AJAX to fetch JSONP.
See more info at http://manual.qooxdoo.org/1.3/pages/communication/remote_io.html
Related
I am now learning while developing my Java web app using JSF, and I was asked to study on using Javascript to create datatable/report dynamically and present it via .html/.xhtml. I am required to use Datatables.net to produce the table. The backend process is using Java instead of Php. Since it is so rare to use this method, I got no idea on this. My thought so far is:
MySQL data --convert to (processed by Java code)--> Json --read by-> Javascript
How do I process the SQL data? Can I directly run the query inside Java like:
SELECT
CONCAT("[",
GROUP_CONCAT(
CONCAT("{name:'",NAME,"'"),
CONCAT("email:'",email,"'"),
CONCAT(",address:'",address,"'}")
)
,"]") AS JSON FROM customer
If so, how do I parse the data out and make sure Javascript will read it?
The another way I found is to use some library like Gson or something similar.
Explanations or examples about this issue is much appreciated.
Im trying to create an encrypted cookie using Javascript Code that Laravel can understand.
My current laravel project includes a pure JS code. In that JS code I displayed a JQVMAP.com Map and people click to define their country. In order to create a location cookie I included the following code:
setCookie(cookieName, code, 60); // minutes
The problem is that the value is created and stored in plain text -> EG: 'US'
But, For Laravel I need to create a cookie in the same way laravel encryption produce one, where 'US' data is represented like:
eyJpdiI6IjBlYlZqUU14ZWt4Q2FKUjNJd25BM.....
Honestly, despite the fact I read stackoverflow and google I was not able to find a way to do that.
any help appreciated
I'm not very familiar with Laravel, but it should let you use plain PHP like Symfony does. In that case you could just read the cookie with the PHP $_COOKIE variable.
Alternatively you could use an ajax call to Laravel and let it set the cookie.
Most of the PHP framework like Laravel, Phalcon etc. are using base64 encode/decode method to secure cookie value. Because base64 method is the only two way encryption, which means you can get the actual value/string once you encrype, which another meaning is you can decrypt the value to the actual value.
So, look for the Laravel source code what method they are using. If it is base64, then you can use javascript base64 encryption/decryption function to secure the cookie value before store to it.
I am developping a client side application with HTML5
my datas (only text data) are stored in my file JSON (70 Mega).
I want to implement a function to search all occurences in my data file.
Does exists open source of this function? or what is the best way to implement it?
thanks for your opinions
If you are planning to use Javascript on the client side, take a look at http://kiro.me/projects/fuse.html
However,70Mb of data is simply too much for any browser to handle and a client side search implementation is definitely not recommended.
I searched all over net for an hour i couldn't find a decent code for updating database using javascript. Can anyone just give me a reference please??
You can do that with Node.js
Here's a sample blog post from interwebz that shows how to do it:
http://www.giantflyingsaucer.com/blog/?p=2596
You need some kind of ServerSide Scripting (php, perl, cgi, java, etc.)
Take a look on this: JavaScript to update MySQL?
JavaScript on itself cannot query any DB for you, as it can work effectively only on the browser. To work with DB you can use use PHP , and use ajax to communicate using $.ajax or $.post methods. A simple search on this will get you references. In short you can use ajax to communicate with PHP script which will in turn query the DB for you.
To start you can take a look at this,
http://webcheatsheet.com/php/connect_mysql_database.php
Main thing to remember is Javascript will only affect your browser.
I hope this helps.
Regards
How would I access a mediarss tag like <media:thumbnail> using basic javascript like getElementsByTagName? P.S I do not want to use a library or server side scripting, also a json object is not available from the rss feed i am using, and i do not want to create one in php...
It seems this issue is covered here, where they talk about using getElementsByTagNameNS.