jQuery UI Map V3 - Localized response - jquery-ui-map

Is there any way to get a localized response with jQuery UI Map V3? I mean, when I use search method to find a location, the long_name value is returned in English.
On API docs I can't find any reference to a locale param or something similar.
Do you guys know something about this?
Thanks a lot.

I answer myself. You can specify the language you want the responses on the script call, like this:
<script src="http://maps.google.com/maps/api/js?sensor=true&language=es"></script>
Of course this is not a jQuery UI Map issue, it's just Google Maps API configuration.

Related

GlideAjax in UI Page with DIRECT flag enabled

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.

How to use Google Map API in CodeIgniter?

How to get started with CodeIgniter and Google Maps API.
I've got a CodeIgniter library specifically for this purpose. You can find more information about it here:
http://biostall.com/codeigniter-google-maps-v3-api-library
A few demos of what can be acheived using the library:
http://biostall.com/demos/google-maps-v3-api-codeigniter-library/
Give me a shout if you have any questions or need any help :)
Enjoy!
CodeIgniter is a backend (server-side) framework. Google Maps API is a frontend (client-side) library. There isn't really any specialized knowledge you need to know about CodeIgniter to get Google Maps working, other than being able to render a view. The question is somewhat flawed in that you assume one depends on the other, when in reality, they are very much decoupled.
The question is similar to how do i get jquery working with codeigniter?...
Reading the CodeIgniter documentation would be a start to understanding how to echo HTML and JavaScript to the browser. The rest is almost entirely client-side JavaScript programming.

Implementing Django Templates and jQuery Templates Together

I'm working on a website that uses AJAX to retrieve data from the server and display it on the page. Django renders the initial page content using its template engine (so it will be indexed by search engines). When the user takes an action, jQuery fetches the new data via AJAX and the response is returned as JSON. I would like to have jQuery render this new content without violating the DRY Principle. Therefore I would like to use a templating engine that is "shared" between Django and jQuery. I've been running in circles trying to find the best solution but always seem to run into a road block.
Has this already been done? Here are the options I have thought of:
Use regular expressions to transform the Django template into correct jQuery template syntax, and render it in its raw form to the page. jQuery will then pick it up and use it to render the new data.
Extend the jQuery template engine to recognize the Django template syntax, again rendering the raw Django template to the page for jQuery to use.
Has this been successfully done before? Either way seems like a lot of work for anything but the simplest of Django templates because of the plethora of Django tags and filters that would need accounted for.
Your best bet is to pick a template language that has both Javascript and Python support, and use that everywhere.
As far as I know, Mustache is your best bet.
I haven't found a perfect solution since I asked this question, but for the sake of development time I resorted to sending back both JSON and HTML in the AJAX response. This way the django templates still perform the HTML generation, but javascript is still free to utilize the data without having to parse the HTML.
I am sending approximately twice the data over the network, but I'm going to live with it until my application grows to the point where a smaller response is beneficial. At that point I will probably look into something like Mustache as Rob mentioned.

Could someone explain hash tag usage for deeplinking ajax applications?

I am currently trying to full appreciate how and when to use hash tags in urls when building an ajax powered website. There seems to be a distinct lack of reading material on the web regarding this technique and as such I don't feel like I've got a good handle on it.
Could someone explain in the simplest terms how the hash tag can be used in urls to enable things like loading pages via ajax.
Thanks
You might want to take a look at Google's Making AJAX Applications Crawlable website.

Ajax using Prototype.js in OFBiz

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.

Resources