Jump to content

CodeIgniter: Appending site url to paths in anchor tags I am getting from JS...


RIRedinPA

Recommended Posts

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

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.