Hey guys,
So here's the issue, I put some javascript on a new item form page to add links to new items. It works in internet explorer, but not in chrome or firefox. I looked through a bunch of posts that were saying to add code to the master page and such for chrome issues... but nothing I have tried as solved the issue. I did notice that the id column in chrome and firefox end with "lookup" instead of "ctl01"... but even changing it to lookup doesnt make it work in chrome or firefox.
This is the error I'm getting: ":/_layouts/sp.ui.rte.js?rev=BLlQeFB9Ir0NFBHuN%2BTQwg%3D%3D:2 Uncaught TypeError: Cannot read property 'parentElement' of null
Here is the javascript:
<script language="javascript" src="http://code.jquery.com/jquery-1.11.1.min.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
jQuery(document).ready(function($) {
$(document.getElementById("ctl00_m_g_99723090_4d65_4080_a237_4cbb0a4af9a6_ctl00_ctl05_ctl00_ctl00_ctl00_ctl04_ctl00_ctl01")).closest("td").append('<br><a href="javascript:var options=SP.UI.$create_DialogOptions();options.url=\'http://urlofpage\';options.height
= 700;options.dialogReturnValueCallback = RefreshOnDialogClose;void(SP.UI.ModalDialog.showModalDialog(options))">Add New Customer</a>');
});
jQuery(document).ready(function($) {
$(document.getElementById("ctl00_m_g_99723090_4d65_4080_a237_4cbb0a4af9a6_ctl00_ctl05_ctl01_ctl00_ctl00_ctl04_ctl00_ctl01")).closest("td").append('<a href="javascript:var options=SP.UI.$create_DialogOptions();options.url=\'http://urlofpage\';options.height
= 700;options.dialogReturnValueCallback = RefreshOnDialogClose;void(SP.UI.ModalDialog.showModalDialog(options))">Add New Contact</a>');
});</script>