Request jQuery Standard Compliant Behavior for $.getScript(...)

DeletedUser118875

Guest
Hey TW Team,

I am submitting this request because I noticed some issues with compliance for the jQuery Standards on a function your code is overwriting. It seems that the game includes either a customized version of jQuery or it is replacing getScript(...) with a slightly more locked-down version. However, the version of getScript(...) that is currently in the game does not honor/respect deferred objects, as included in the jQuery 1.5 specifications ( https://api.jquery.com/category/deferred-object/ ). The following web console output screenshot demonstrates this problem:

6SKySJ2.png


As you can see, $.getScriptOrig(...) (the original version of getScript from the jQuery library) works exactly how it should in jQuery v1.9.1 (the jQuery version the game is running), but the forked replacement for getScript(...) causes unexpected behavior.

Should script developers rely on getScriptOrig(...), and can we do so with any kind of guarantee of reliability in future game updates, or can the Tribal Wars team make their replacement version of getScript(...) compliant to produce expected behavior/results?

Thank you,
Ghost
 

Ibra Gonza II

Non-stop Poster
Reaction score
140
I would just use $.get tbh

The only difference between that and $.getScript is that the ajax call parameter datatype is filled in with "script". Other than that they do the same.
I have been using it since beginning of time. It might solve your issue, of calling to a php source, by just passing the datatype argument to the $.get.

I even think it wouldn't be necessary if you set the headers in the php file to javascript. The $.get should take care of that itself.

I've never done this myself (as I always just use $.get to a javascript file), but I wouldn't see why that wouldn't work.
I'm sure Tribal Wars has it's reasons to overwrite the function and it is unlikely they'll change it's behavior just to make scripters happy, and just as with every update you can't rely on things staying as it is. They can't, and should not, take into account the tons of scripts that are being written. It's up to us to keep modifying them if things change. So I would just use $.getScriptOrig (I didn't even know this one existed :eek: , thanks!) or $.get()
 

DeletedUser

Guest
Ironically, $.getScript seems punched to help with scripts.
INEJVFd.png
 
Top