Posts Tagged javascript

Using Openx Magic Macro and dynamic variables in HREF / html code

Ok, so this is pretty obscure but I felt the need to post it considering the results that I’ve seen are totally contrary to the published resources from openx and the community.

What I want is to pass along variables via the href / html code that appears in the <noscript> tag.  If I pass it along via the javascript as are the instructions most places it works exactly how it is supposed to according to all the literature out there, but the moment I want to pass those variables via the pure html code within the <noscript> nothing works, no variables are passed.

I went for help on IRC and didn’t get a response after waiting 12 hours, I posted a question on their forums and it got deleted, so if you want a support model to follow with your business look else where because openx sucks donkey balls.  That aside I was tinkering for a good hour and noticed some weird behavior when I forgot to put one of my variables into the destination url after removing it for some testing.  I left it out of the dest url but put it back into the href tag and viola, it’s getting passed on.

Soooooo, what you need to do to pass variables / magic macros along to openx via the HREF tag you need to do two things, one of them completely contrary to all instructions out there.

First your html on your page should look something like this:

<a href=’http://domain.com/openx/www/delivery/ck.php?n=a4342876&amp;cb=235364574&amp;VAR1=3505&amp;VAR2=222222′ ><img src=’http://domain.com/openx/www/delivery/avw.php?zoneid=21&amp;cb=235364574&amp;n=a4342876&amp;VAR1=3505&amp;VAR2=222222′ style=”margin-right: 2;float: left;” border=”0″ alt=’_fullTitle_ in _CITY_’ align=’left’></a>

and then in your destination path for the banner itself make sure that you do NOT and I repeat NOT have any reference to those variables.  Just have the plain jane dest url as is and it should work.

VAR1=3505&amp;VAR2=222222

Tags: , , , , , , , , , ,

Not all Javascript popup boxes are created equal

I was implementing a feature onto one of my networks today and needed to use a javascript popup box to bring up a booking table.  You know those cool boxes that darken the rest of the screen and popup a slick looking window?  Well I needed one and apparently they all such except the one titled: “A pop-up window that doesn’t suck“.  You can skip this article and go straight to it here if you want: http://orangoo.com/labs/greybox/installation.html

 

The first box I tried was TinyBox which looks great,  probably the slickest looking of the boxes but it had problems loading a php file in an iframe properly.  You see I need it to load page.php?id=5555 where 5555 would go into certain areas of the page that get that url variable.  It loaded all the code properly it just wouldnt’ execute the php within the page.

The second one I found was Thickbox which worked out well enough again,it looks slick, not as cool as TinyBox but still nifty however unfortunately we encounter the same problem.  Php is loaded by not executed… Booooerns

The saying ‘third time’s the charm’ applies perfectly here because last but definitely not least I found GreyBox which is aptly titled: A pop-up window that doesn’t suck which turned out to be not just a euphamism but actually true because unlike the cool looking shitty boxes prior that wouldn’t execute my php Greybox worked like a bloody charm.  Unfortunately it doesn’t quite look as cool however I was able to customize the close button and change that grey gradiant so it at least looks a bit better.

Tags: , , , , , , ,

Emailto Script to beat the spambots

Found this today and was impressed with it's simplicity and genius, wondering why I haven't seen it before this.  Allows you to enable users to one click email you from a link on the website while offering you protection from spambots picking up the email addy and adding to the list:
Javascript that goes in the html
<script language='Javascript'>
<!--
    function emailto(dom,from,nam,tld,add) {
        location='mai'+'lto:'+from+nam+'@'+dom+'.'+tld+add;
    }
//-->
</script>
this code replaces the standard mailto code in the HREF tag:  javascript:emailto('wadjeteyegames','','admin','com','')
enjoy

Tags: , , , ,

Page optimized by WP Minify WordPress Plugin