pokemon-go-iv-calculator icon indicating copy to clipboard operation
pokemon-go-iv-calculator copied to clipboard

PHP?

Open fix89 opened this issue 8 years ago • 4 comments

Can i call this JS function in a php file? Thanks

fix89 avatar Aug 03 '16 10:08 fix89

you can use browserify to make this fully client side and then just use it like any other javascript in the frontend

ZeroDragon avatar Aug 03 '16 16:08 ZeroDragon

Hi @ZeroDragon I'm interested about your suggestion, unfortunately I never used browserify.

I installed it through: npm install -g browserify

than I run: npm install underscore

and than: browserify index.js -o bundle.js

is that correct? Now to use it in a html5 form, I simply add this bund.js into the head section?

what's the functions to call from my form?

Thank you for you precious help.

best regards ^^

ethernalyIT avatar Aug 12 '16 11:08 ethernalyIT

This is exactly what I did:
temp.js
ivCalculator = require('pokemon-go-iv-calculator');

Then just run
$>browserify temp.js -o ivCalculator.js

As you said, in my <head> I called it like this
<script src="/scripts/ivCalculator.js"></script>

And finally in my main.js I did this:

calc = ivCalculator.evaluate(pkmnNumber,CP,HP,Stardust,upgraded);

ZeroDragon avatar Aug 12 '16 14:08 ZeroDragon

Thank you @ZeroDragon ! I'll try!

ethernalyIT avatar Aug 13 '16 10:08 ethernalyIT