CodeRedLLC Posted February 26, 2019 Report Share Posted February 26, 2019 I finally bit the bullet and re-deployed all of my DataPages with asynchronous deployment. I'm having a problem writing a javascript that I used document.write for. Any help would be greatly appreciated!! <script type="text/javascript"> var cb_boolean = '[@field:Courses_Status]'; if(cb_boolean == 'Accepted') { if([@field:Courses_Student_Count] <[@field:Courses_Estimated_Attendance]) { document.write("<a href='http://[@app:domain]/pm_admin/training/details/registerstudent/[@authfield:Account_regpath]index.html?Course_Number=[@field:Courses_Course_Number]' target='_blank'><b>Register Student</b></a>"); } else { document.write("<p><b>Class Full</b></p>") } } </script> Quote Link to comment Share on other sites More sharing options...
George43 Posted February 27, 2019 Report Share Posted February 27, 2019 You should use selector and custom html block in order to write information. Document.write() is not available due to security policy of the Chrome Browser. Example of the code. You should use HTML block with disabled editor <div id='elem'> </div> <script type="text/javascript"> var cb_boolean = '[@field:Courses_Status]'; if(cb_boolean == 'Accepted'){ if([@field:Courses_Student_Count] < [@field:Courses_Estimated_Attendance]){ document.write("<a href='http://[@app:domain]/pm_admin/training/details/registerstudent/[@authfield:Account_regpath]index.html?Course_Number=[@field:Courses_Course_Number]' target='_blank'><b>Register Student</b></a>"); } else{ document.getElementById("elem").innerHTML="<p><b>Class Full</b></p>"; } } </script> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.