Custom js script code giving jquery is not defined error in editviewdef

Hi All

In editviewdef am including js file and when am writing my script am getting Jquery is not defined error.

I even tried with Jquery noConflict but no use same error am getting.

By default jquery library will be include but for my custom js its not calling.

How i need to get rid from it.

Thanks in Advance

Regads

Syed

Parents
  • Hi Sayad Sharif

    Instead of using includes for including your js file in editviewdef, try in this way.

    In your editviewdef file under templateMeta array add javascript to do so:

    'templateMeta' => 
        array (
           'syncDetailEditViews' => true, //After this line add javacript code
           'javascript' => '      
                <script src="./include/javascript/jquery.min.js" type="text/javascript"></script>
                <script src="./custom/include/javascript/test.js" type="text/javascript"></script>
           ',
        ),
    

    Now in your custom/include/javascript/test.js file write all your script code to do so:

    $(document).ready(function(){
      console.log("Hi Friends am Triggered..");
    });
    

    Once check with this approach and let me know if you found any issues.

    Hope this Helps

    Best Regards

    S Ramana Raju

  • Hi Ramana Raju Santhana

    You made my day Ramana.

    I was trying from 2 days and now with your help i have solved this problem.

    Thanks a lot for your help.

    Regards

    Syed

Reply Children