RIRedinPA Posted March 23, 2011 Share Posted March 23, 2011 I've inherited a project which is just a intranet document storage type of site. There's a drop down list of categories and a table that gets filled with the different documents associated with those categories. When an option in the drop down is selected jQuery captures it and uses ajax to build a querystring (a CI happy URL) and then it eventually returns a string that is the html for a <tbody></tbody> I get this back: <tr><td class='fileName'><a href='xxxxxx.xxxxxx.com/salesadmin/Education/Education-Collection-Process-and-Chargeback-Policy.doc' target='_blank'>Education Collection Process and Chargeback Policy</a><p class='fileDescription'></p></td><td class='fileExtension'><p class=doc>doc</p></td><td class='fileModed'>2010-08-10 07:52:30</td><td class='btn'><a class='btnEditLine' name='5' href='javascript:' title='Click to EDIT: "Education Collection Process and Chargeback Policy"'>Edit</a></td><td class='btn'><a class='btnDeleteLine' name='5' href='javascript:' title='Click to DELETE: "Education Collection Process and Chargeback Policy"'>Delete</a></td></tr> The href is correct, it is pointing to where the downloadable files are located. But for some reason when I roll over the links in the browser they are being prefixed with the site url: http://kopmacwwwo1.xxxxxxx.com/InternalAdmin/admin/index/xxxxxx.xxxxxx.com/salesadmin/Education/Education-Collection-Process-and-Chargeback-Policy.doc I console.log everything right up to where it is inserted into the tbody and it is correct. Is this something CI is doing and if so how do I correct it? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/231517-codeigniter-appending-site-url-to-paths-in-anchor-tags-i-am-getting-from-js/ Share on other sites More sharing options...
codebyren Posted March 26, 2011 Share Posted March 26, 2011 Once the content has been rendered, CodeIgniter's job is done. And since you say the href is correct when the page has been loaded, CI can't be at fault here. It sounds like you have some javascript (you mentioned jquery) that is dynamically prepending the site URL when you hover over these links. If you disable javascript in your browser you should be able to confirm this - so I'd start with that. You might want/need to use something like firefox's web developer toolbar to only disable javascript after the relevant <tbody></tbody> content has been loaded in via ajax. Quote Link to comment https://forums.phpfreaks.com/topic/231517-codeigniter-appending-site-url-to-paths-in-anchor-tags-i-am-getting-from-js/#findComment-1192684 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.