View Single Post
Old 01-07-2013, 04:55 PM   PM User | #1
WolfShade
Regular Coder

 
Join Date: Apr 2012
Location: St. Louis, MO, USA
Posts: 950
Thanks: 7
Thanked 98 Times in 98 Posts
WolfShade is an unknown quantity at this point
Can a containing element affect content functionality?

Hello, everyone.

I'm not currently having an issue, but I am trying to understand something. Input is appreciated.

I am using jQuery 1.8, and in one particular document I have set up something that will delete certain files stored within a database. I can't type all the code, here, but I'll try to present an accurate facsimile.

The links to delete a particular file were anchor tags within a span, like so:
Code:
<span style="display:block;" id="span_{ unique identifier }">
  <a href="javascript:void;" name="del_{ same unique id }" id="del_{ same unique id }" class="delFile"><img for delete icon /> FILENAME.EXT</a>
</span>
Within document.ready, I had the following:
Code:
$('a.delFile').click(function(evt){
  var delID = $(this).attr('id'), spanID = delID.replace(/^del\_/,"span_");
  delID = delID.replace(/^del\_/,"");
  [[ function to delete file by ID ]]
  });
This is working fine in both IE and FF. But something has me perplexed.

I temporarily changed the span tags to paragraph tags, and while it still worked in IE, it stopped working in FF. I reverted back to span tags, and it's working just fine, again. But I'm confused as to why a <p> would prevent the delete function in FF, when <span> had no problem.

Any ideas?

Thank you,
__________________
^_^

If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
*
The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".
WolfShade is offline   Reply With Quote