skip to Main Content

Any help will be appreciated.

 <button type="button" 
       id="myBtn" class="btn btn-primary"
       data-toggle="modal" data-target="#myModal"
       onclick="notify({"IP": "0.0.0.0-255.255.255.255", "app_code": "", "custodian_email": "", "custodian_id": "", "custodian_name": ""})">
     <i class="fab fa-telegram-plane" style="margin-right:5px"></i>
        Notify
    </button>

2

Answers


  1. You’re using double quotes to delimit the onclick attribute value, and also to delimit the strings inside the attribute. That can’t be parsed, because the double quote before IP ends the attribute. Use single quotes for one of them instead.

    <button type="button" 
       id="myBtn" class="btn btn-primary"
       data-toggle="modal" data-target="#myModal"
       onclick='notify({"IP": "0.0.0.0-255.255.255.255", "app_code": "", "custodian_email": "", "custodian_id": "", "custodian_name": ""})'>
     <i class="fab fa-telegram-plane" style="margin-right:5px"></i>
        Notify
    </button>
    
    Login or Signup to reply.
  2. You are using ” as closing and opening tag in the inner dict and in the function, just change

    notify({"IP": "0.0.0.0-255.255.255.255", "app_code": "", "custodian_email": "", "custodian_id": "", "custodian_name": ""}

    to:
    notify({'IP': '0.0.0.0-255.255.255.255', 'app_code': '...'})

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search