I'm trying to obtain the correct content for each language (I'm using qtranslate plugin in Wordpress environment) loaded by Ajax calls.
Every time, contents are shown up only in the default language.
I'm thinking about to pass the default-language-qtranslate variable into the ajax calls but I don't know how.
Maybe someone out here has already solved this issue..?
Thanks guys
This will help you to fix the default language request in Mailpress, or any other plugin.
Search in code for link request "ajax.php". Replace "ajax.php" with ajax.php/?lang='.qtrans_getLanguage()
Related
I am relatively new to ServiceNow, and I am building some UI pages where I basically do not need any of the SN structure except for Glide Ajax (I need to get data from a Script Include).
The problem is that when I select "Direct" the Glide Ajax functions are not available any more in the client script.
Does anybody know if this is possible to achieve? I searched everywhere without success.
Thanks a lot!
If you check "Direct", it omits all ServiceNow specific JavaScript and CSS. "GlideAjax" is ServiceNow specific JavaScript.
If the data that you are pulling back from the Script Include is static (meaning that you can pull it when the UI page is loaded) then you can probably do it inside an "evaluate" block in the HTML section of the UI page. You could have your Script Include return a JSON object as a string and store it in a variable. Then you could have your client JavaScript parse that variable. I am not a Jelly expert, so I would be curious to know if it works.
I am trying to implement a comment mechanism in which a user can post a comment and also upload multiple files with it. I am using a g:formRemote for the comment part but I learned that ajax request does not supports file uploads. SO how do I do this? I found few plugins but they did not work for me as I have to save comments as well and these plugins did not support that. I found a way on internet by using iframes, but I am not sure how to do that. Any help would be very appreciated. Thanks
Try to use jQuery Form plugin, it supports ajax file uploads as well so you don't need to implement this by yourself. It also allows to track upload progress.
I have a small problem that seems to be big enough to hold me from my work.
As I said in the title, I am leaning Yii and after I developped my project, I realized that I don't have ajax check.
I tried to solve this by setting enableAjaxValidation to true and it didn't worked. I tried to make use of the method performAjaxValidation and, again, it didn't worked. The third way was to copy the content of performAjaxValidation and paste it inside my method (like in documentation and identical with the code generated by Yii.
I checked my js and they are loaded.
What could it be? How can I solve this? The problem is that I need my fields to modify while the user is completing the form.
Thank you!
PS: I checked some topics from stackoverflow but the only one who was related was Yii - Ajax Form with validations
Make sure the from that is being validated has the same ID that is being used in the performAjaxValidation function. For example if your form has the id product-form, the if statement should look like this:if(isset($_POST['ajax']) && $_POST['ajax']==='product-form')
If possible I recommend using Firefox with firebug extension so that you can debug whether the AJAX call is even being made, and what is being returned.
I am looking for a way of replicating what the site in the title of this question does. That is, via ajax, changing a part of the page. But, I could not figure out how to change the URL as these things happen.
So, please, help me achieve the effect of url changing on ajax page/change.
Thank you.
(edit ** question rewritten as is appears it was not written well enough, sorry)
What you are looking for is AJAX basically updating only parts of a HTML page. Please google for AJAX tutorials. Here is a simple one
Something like Jquery Tabs also do this.
It seems like you want the URL to change. This is the basic trick to have history for ajax pages
I need to make an Ajax call inside OFBiz framework using prototype.js. I am doing that from a .ftl file. I am confused about how to handle the server side - through Java event or Java service? What is the best practice? And also I am having problems making the framework recognize the prototype.js file. There is some issue with the path name in the script tag. It has to be some peculiar naming as per OFBiz framework standards.
I searched Google but I only found links on how to use prototype but none on the combination of prototype + OFBiz. If anybody has done anything in OFBiz like this, please help.
The server process the AJAX request just like any other request. It may contain an event or not, and the response your js function will get is the HTML output ( if the response is a view ). If you want to use JSON, you must create an event with type="jsonservice" ( and you must include the jsonservice handler in your controller file ). This way you can send and receive data structures using AJAX.