Skip to main content

Posts

Showing posts with the label hyperlink

How to detect Outgoing links (apache,php..)

I'm developing a website, but stuck at some point, where i needed to detect outgoing links on my website, and either forbid the links, or accept that, i don't know how facebook is doing this, but they can do it through facebook.com/l.php that if the link is marked spam, users will get notified about it. I don't know if that's a php or htaccess, it worked in php using the DOMDOCUMENT, but it's not a real solution for this.

jQuery IF var = value or #id clicked

I have the .live aspect working now so if links are clicked, my function is executed, but I'm trying to figure out how include an option for a direct link to the content as well. Something like this: $(showDiv).is('shipping-timeline') or $("#inm_if_hc_shipping_timeline").live('click', function() { [code to show and hide divs] }); showDiv contains the value that identifies the proper id, extracted from the URL. My Question: How do I construct the IF statement to execute if either case is true? Can anyone help? Thanks! UPDATE: So I took the IF parts from Graydot's answer and applied it to my code and here is a more complete example of what it looks like now: $("#inm_if_hc_faq").bind('click', function(e) { if(showDiv == 'faq') { // prevent default behavior e.preventDefault(); $("#inm_if_hc_content_faq").show("slow"); $("#inm_if