Implementing custom JS into Website based App


#1

Hi, I have a e-com website restricted to a very specific audience. I have been trying to create the app based version using Ionic but I am having some trouble in using the Generator code which is made up of JavaScript code.

It is not working on the app version when testing.


#2

This is not even nearly enough information…


#3

Hi, thanks for reaching out. What should I provide more?

This is the JavaScript code of the generator that I think has been messing with the app code -

p.s. the code is executing perfectly on the on my eShop codes website.

function makeId(length) {
  var text = "";
  var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
  for (var i = 0; i < length; i++)
    text += possible.charAt(Math.floor(Math.random() * possible.length));
  return text
}

#4

Just ran it fine.

How are you making use of it within your code?
Do you have an example repo with this?


#5

Hi, the code the working fine with me too but on the website. When I’m trying to add it in a button on the app, then it is only crashing.


#6

You will need to provide a lot more example.

Share an example repo and I’m happy to take a look.