dojox.io is undefined - dojo

I use dojo mobile for my mobile application. I like to show any contents of another site in my application. for this I will get content from my site.
I found out that for this I shold use cross site xhr. But I get error a dojox.io is undefined error!!!
I'm really frustrated. I search the whole day, but without success....
can anyone help me with a small example (with all informations and really domain-name). Which "require" do I needed?
thanks in advance
dimi

Since you are trying to call the dojox.io.xhrPlugins.addCrossSiteXhr function, to get the module name all you need to do is remove the function name:
dojo.require('dojox.io.xhrPlugins');
The only exception to this rule is when you require a class, since the class name is already the module name.
dojo.require('dojit.Tree');
If nothing still works, you can always fallback to finding the module file by hand, since the module name is correlated with the file path.

Related

Why can't I find traci.vehicle.getIDCount()?

I am trying to get the total number of vehicles in the scenario. I checked wiki, it says the method traci.vehicle.getIDCount() can do it. But somehow I cannot find the definition of this function in SUMO's Github or my local pc. But actually I can run the code without errors.
Can anyone explain why I can't locate such a function but I can run it?
The function is defined in the file traci/domain.py. All the individual domains such as vehicle, edge etc inherit from the Domain class defined in this file and so inherit this function as well. I cannot tell though why your search is not successful because the code is right there (on Github and probably on your machine as well).

Ionic 3 - Load translation from API URL

I'm actually working on a mobile app with Ionic 3, everything is ok till now. Eveything work fine. I set translation with ngx-translate. So i got all my files in a folder "/assets/i18n/". I can call my data in templates or components so everything is ok.
But my client, wants that those translation files come from a web API. SO they can update them as they want. I searched here on found some things like this link "Ngx-translate - TranslateHttpLoader with external URL" ( I didn't want to answer this topic cause I don't have answer, just questions and as my profile is new I can't comment it )
I read all of this but i can't understand it perfectly so, i keep missing something, so please how can i create a custom loader for calling those translation file ?
I tried to create a provider/service but is that a specific kind of file for a loader ? Where to put it in my app ?
That's the last stop for my app to run. So please if someone know the answer can you help me a little bit with it ? I want to understand exactly how to call those json film from URL !
I can add more code if you want, but actually i got no error i just don't know how to create this "loader" from last topic. And where to put it.

Can't upload new product image backend prestashop

I need a little help here, i hope someone here can help me for a hint or clue.
First of all, I'm not programmer. I'm just web admin who can use cms and basic html.
I was using PrestaShop for my online shop. In the backend, I can't upload new product image anymore.
The error just blank without any sign for me. Here for the screenshot:
I appreciate it, if someone can help me, thanks, and sorry for my english.
#PanjiWiyono This errors don't really give us a quality information, but this is a start. In your JS code should be a ajax query that has an error when converting results to json (first error). You should check what's the exact error that this request is returning by inspecting in browser developer console.
If you detect that the second error is in fact, the response of this ajax query, well now we almost have the problem.
The second error should be related to data size. Check this: Error while sending QUERY packet
Anyway, you should check DbPDO.php class. You can use debug_backtrace function to display the complete stack, but definitly if error is related to a basic PHP class issue you will have not help knowing wich classes are in calling stack.
Good luck.
Simple solution
maybe a extra module is in a conflict with the prestashop core files. go to advanced parameters, performance and disable third party modules and try again.
other option is reupload admin folder with other name and
js folder check again
hope it will work for you

Multiple modules in a page ZF2

I'm using Zend framework 2 and I want to load several modules in one URL... but i don't know how to do that, I tried to play with route but nothing worked...
So here I am!
Thanks for helping :)
The quick answer is that you need to choose (perhaps create) ONE module and define the appropriate url route in there, then reference your other modules using the service manager and view helpers from your controller function and view respectively. So it all orients around a single controller function which makes calls to the other modules.
If you still need help with this let me know and I'll try to find you some code examples by the end of the weekend. Also, let me know exactly what you're trying to do (partly so I can help but partly out of curiosity).

Passing the arguments to a website

Well the title is tricky. I was not sure if this has been already there and how to put it.
Example:
Lets suppose my site is accessible:
http://mysite.com
if mysite does additions: with 2 inputs
Now If the end user need to pass an argument to site like this (so i load the page like this):
http://mysite.com/argument1/argument2
so it should be able to thus go to the result directly: arg1+arg2
This brings to the question:when user types this, how can i retreive argument1 and argument2 and load my site according to that? Is it possible? If yes, Any client site programming solutions?
Thanks in advance.
Found the solution after searching a lot. The correct term for this process is URL-routing. We can overcome this by using #.
www.mysite.com/#/argu1/argu2
Then in the document.ready() we can read the url in the following manner:
var url = window.location;
More sophisticated way is to use the "backbone.js" for the routing. The documentation on the link explains everything
Backbone.js routing