JavaScript - Issues With Doubleclick Tags Implementation Using Js
Hey guys,
We have implemented dfp on our network using js and xml but are having issues with companion ads. We are looking for someone to tweak our js since we are running out of ideas, we would of course compensate you for your time. Basically what we are doing is scanning our page for specific <DIV> after the page has loaded, match that div and url with an XML file then insert the proper doubleclick tag to display our ads. example: <div class="_DblClick" id="300x250top" size="300x250" pos="top"></div> It has been working like a charm until we started to do sponsorships whith companion ads: Here is an example of a page working perfectly (hard coded tags): http://emmisdigitalvault.com/test/tag-hardcoded.html Here is the same campaign using JS, you will notice that on some refresh sometime wrongs ads will show up: http://emmisdigitalvault.com/test/tag.html Here is the feedback we received from google: My investigation indicates that the ads sometimes appear in the wrong order because the ad calls from the three ad tags on this page are not always made in the order intended. The ad tags appear to be dynamically generated by scripts that aren't accessible externally, with the responses from the DFP ad server then automatically inserted into the page. In order for Roadblocking (master/companion pairs) to function properly, the ad calls must be made sequentially, with the ad tag that calls the master first and the ad tag that calls the companion immediately after. In the case of this website, it appears that the order of the ad calls can vary with each page load, making which ads serve to the two 300x250 ad slots unpredictable. If you have already encountered this road block or can think of a solution please contact me Similar TutorialsHello, Please take a look at http://dev.wanderthewest.com/test2_good.html Each of the left links link 1 link 2 link 3 link 4 link 5 simply calls the my_ext_func() JS function (defined in a different IFRAME!). so far, so good. now please also open http://dev.wanderthewest.com/test2_bad.html "link1" here for example shows in my FF the following error: Error: Permission denied for <http://dev.wanderthewest.com> to get property Window.my_ext_func from <http://googleads.g.doubleclick.net>. Source File: http://dev.wanderthewest.com/test2_bad.html Line: 31 and similar ones for link 2 link 3 link 4 link 5 now, what is the difference between test2_bad.html and test2_good.html ? test2_bad.html simply has the ADSENSE code on top of the google map. please look again at the error returned in FF: Permission denied for <http://dev.wanderthewest.com> to get property Window.my_ext_func from <http://googleads.g.doubleclick.net>. in other words http://googleads.g.doubleclick.net doesn't like the fact that I am trying to call a function from another IFRAME (Window.my_ext_func). Do you have any idea how to fix this? I really must use some links that call a JS function defined in a different IFRAME. Thanks a lot for your time. Sorin Hello everyone, I needed some help on finding a complete code which implements DES in either c++ or Java. Thanks Hello all and thank you in advance. I am very unfamiliar with Java and hope someone can help. I have a site using a wordpress theme and want to add the +, -, and reset buttons to control the text size. I am using this site http://go.internet.com/?id=474X1058&...php%23examples as my tutorial and am finding out that this is not a step by step buy requires prior knowledge for java coding. For step one I copied the 3 lines of code and placed them in the header. Then for step 2 I placed them in the single post editor (not sure if the link "#" needs to be changed. And for step 3 I am lost completely. I downloaded the file linked on that page which includes 4 .js files, which I am not even sure if I will need. Is this something anyone here can help me with? I am familiar with html and css, and very little php coding, but this is confusing. Thanks. Hi guys, I need your expertise regarding my dilema. I was able to create a simple google map html page at our web server, this web server has access to the internet. the problem is, when this page is accessed from a different PC that has no internet access, the google map won't work. I know that javascripts are run at the client side, so i'm asking is it possible to run everything at the server, including the javascripts and still output the google map? i used this tutorial to make my google map page : http://googlemaps.mayzes.org/ I'm looking for something that allows me to add tags to a photo like this website: http://fukung.net By clicking add tag it opens a input box and once added adds to a DB. How would I do something along those lines? Where to put the <ol>&&</ol> tags so everytime i run the javascript it numbers each indivdiual items which the javascript is looping. Code: <table border="2"table align="center" cellpadding="40"> <tr> <th width="80%"> Questions & Time</th> <th>Status</th> </tr> <tr> <td><% for (int i=0; i < theList.size(); i++) {%> <tr> <td><%= theList.elementAt(i)+ " " + theTime.elementAt(i) %> <% }%> </td> <td>Where is the pending goes:</td> </tr> <tr> </table> Hi, hope someone can see an answer here. I have 4 div tags which are hidden to begin with from the css as shown below: Code: #story1 {float:left;width:100%;display:none;background:#333;color:#fff;vertical-align:top;} #story2 {float:left;width:100%;display:none;background:#333;color:#fff;vertical-align:top;} #story3 {float:left;width:100%;display:none;background:#333;color:#fff;vertical-align:bottom;} #story4 {float:left;width:100%;display:none;background:#333;color:#fff;vertical-align:bottom;} The contents of these is pulled out of a db and so the quantity of text changes (within certain parameters) and so the size of the divs changes, hence no height: setting. I know I could get around this by setting an absolute height and using overflow to show a scrollbar but I would rather not have a scrollbar as the amount of text will only be 100-200 words. Elsewhere I have used the following script to equalise div tags Code: if (document.getElementById("member1").offsetHeight < document.getElementById("member2").offsetHeight){ document.getElementById("member1").style.height = document.getElementById("member2").offsetHeight + "px"; } else { document.getElementById("member2").style.height = document.getElementById("member1").offsetHeight + "px"; } I tried this for my div tags but because they initially start with display:none it sets the height of them to zero. Is there a simple way to make all of these the same height whilst they are hidden? hi Guys , I have some instructions in property files , now I wat to retrive that fmt tag values in scriptlets So that I can modify the content in property file So i have written the code in jsp as <c:set var="mailBodyData" value='<fmt:message key="confirmemail.body.message"/>' scope="request"/> <% out.println("hero "+request.getAttribute("mailBodyData")); %> but its displays empty , Also I have tried as <% String str ="<fmt:message key="confirmemail.body.message"/>' %> but its throughs the Compilation error , Pls help , So that I can retrive the data from fmt to Scriptlets I am trying to replace all newline characters with <br /> tags. The following two javascript functions that I've found, work in Firefox but do not work in Internet Explorer (I have version 7 installed on my machine). I would really appreciate any pointers on how to get this done. Thank you! Joe PS: I am using jQuery to call these functions. And this is how my JSP page looks like. Code: <html> <head> <title>New Line Replacement</title> <script src="/js/jquery-1.3.2.min.js" type="text/javascript"></script> <script type="text/javascript"> function replaceNewLine(myString) { var regX = /\r\n|\r|\n/g; var replaceString = '<br />'; return myString.replace(regX, replaceString); } $().ready(function(){ $(".replace-text").each(function(i) { var sBody = $(this).html(); $(this).html(replaceNewLine(sBody)); }); }); /* function nl2br(text){ text = escape(text); var re_nlchar; if(text.indexOf('%0D%0A') > -1){ re_nlchar = /%0D%0A/g ; }else if(text.indexOf('%0A') > -1){ re_nlchar = /%0A/g ; }else if(text.indexOf('%0D') > -1){ re_nlchar = /%0D/g ; } return unescape( text.replace(re_nlchar,'<br />') ); } */ </script> </head> <body> <div class="replace-text">${model.paraOne}</div> <div class="replace-text">${model.paraTwo}</div> </body> </html> I was wondering how somebody might be able to do the recognizing text between the php tags and making it into colored text in its own colored area like codingforums has done.
I'm using forum with bb rich text editor, the problem that sometimes when a user copy and paste content, there ere extra codes that are not supported like: Code: [highlight=#ff0000][/highlight] [blockquote][/blockquote] [CENTER ALIGN=CENTER][/CENTER ALIGN] Can you help me to write a script that automatically reformat the html content when pasted and only keeps specified tags like [img],[url],[b], defined in array ... If it is not possible to reformat content when paste, I can add a button to the editor and call that function to format the content and return plain text with a specific tags. I tried this script: Code: function removeHtmlTag(strx){ if(strx.indexOf("[")!=-1) { var s = strx.split("["); for(var i=0;i<s.length;i++){ if(s[i].indexOf("]")!=-1){ s[i] = s[i].substring(s[i].indexOf("]")+1,s[i].length); } } strx = s.join(""); } return strx+''; } It made to strip html tags, I replaced <> with [], It removes all tags and don't put space instead of the removed tags, example: Code: hello[h1]Name[/h1] Will be like : helloName ??? I got an idea to make a stupid trick, like converting [IMG] to {IMG} and run that function and re convert {IMG} to [IMG] ... Please help, I'm not good in Regular Expressions. Thanks for your time, Regards. Hopefully this is a simple problem with a simple solution but I cannot find it as of yet. Here is an example: The following is a link that goes nowhere, it has a mouseover listener function registered. The function works in firefox but not IE. I have also tried to 'attachEvent' for IE instead of 'addEvent' but this too does nothing. Is it possible to attach a mouseover to an anchor tag in ie or am I wasting my time? Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <script type="text/javascript"> window.onload = function(){ document.getElementById('test').addEventListener('mouseover',function(e){ alert("mouseover"); }, false); } </script> </head> <body> <a href="#" id="test">mouseover</a> </body> </html> -Jon Hi, I have a regular expression which removes anything between <script> and </script> tags. The problem comes when there is more than one on a page, eg. Code: <script>lose this</script> content I want to keep <script>lose this</script> Everything in that string is removed... how can I limit it to complete tags only? I did a search but could only find ones that either remove tags only, or have the same problem as mine. Cheers, Gus Hi there... I have a question for the following code (a callback func for ajax) Code: function callBackFunctionForAddAdmin(data) { alert(data); } If we get the following alert message Quote: <result><error>the given userid is already admin.please enter another one.. </error></result> How do i extract the data inside the "error" tag?? (first checking if it exists and then if so extracting it) I have been working on this code for days and I cannot get it right!!! Can anyone please give me any pointers. It should have an error message that pops up on same line as text boxes when into is not entered property! Thanks in advance! NewBanks <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script type="text/javascript"> function validate(){ var errorList = new Array(); var eMail = document.getElementById("email").value; var passwrd = document.getElementById("password").value; var cPassword = document.getElementById("confirmPassword").value; var secQuest = document.getElementById("securityQuestion").value; var secAns = document.getElementById("securityAnswer").value; var regEx = /^\s*[\w\\+_]+(\.[\w\\+_]+)*\@[\w\\+_]+\.[\w\\+_]+(\.[\w\\+_]+)*\s*$/; if(!regEx.test(eMail)){ errorList[errorList.length] = ("You must enter a valid email address!<br/>"); valid = false; } if(passwrd == "" || passwrd.length <6){ errorList[errorList.length] = ("Your password must be 6 characters long! <br/>"); valid = false; } if(passwrd != cPassword){ errorList[errorList.length] = ("Passwords do not match! <br/>"); valid = false; } if (secAns == ""){ errorList[errorList.length] = ("Please enter your Security Answer! <br/>"); valid = false; } if(errorList.length > 0){ for(var i = 0; i < errorList.length; i++){ document.getElementById("errors").innerHTML += errorList[i]; } return false; } else return true; window.onload = function() { 0(); } } </script> </head> <body> <form id="login" action="confirm.html"method="get" onsubmit="return validate();"/> Email: <input type="text" name="email" id="email" onblur="validate(this);" /> <br/><span id = "Invalid Email"></span> Password: <input type="text" name="password" id="password" onblur="validate(this);" /> <br/><span id = "Incorrect Password"></span> Confirm Password: <input type="text" name="password" id="confirmPassword" onblur="validate(this);" /> <br/><span id = "Invalid password"></span> Security Question: <select id = "securityQuestion" onblur="validate(this);"> <option value= "maiden" >What is your mother's maiden name </option> <option value= "animal"> What is your favorite animal </option> </select> <br/> <input type="text" name="securityAnswer" id="securityAnswer" onblur="validate(this);" /> <br/><span id = "Security Answer does not match"></span> <p><input type = "Submit" /></p> <span id = "errors"> </span> </form> </body> </html> I forgot how to do this. I did this a long time ago but have deleted the example. I want to absolute position 11 scrolling div tags of the same dimensions with the same top and left positions. In other words, on top of each other. This is easy. What I can't remember how to do is trigger them so one shows up and the others are hidden. Code: <style> .one { position:absolute; top:200px; left:0px; background:skyblue; width:250px; height:250px; } .two { position:absolute; top:200px; left:0px; background:aqua; width:250px; height:250px; } </style> <input type="button" onClick="" value="one"> <input type="button" onClick="" value="two"> <div class="one">one</div> <div class="two">two</div> Hello there, I have one drop down list having some characters name. I have created this list dynamically using javascript. I have <h3> tag in html having same characters' name using that I had created drop down list. There are <blockquote> along with <h3> tag which is speech of that character. I have to generate the javascript in such a way that, if character "A" is selected and sppech belong to that character should be visible. Is any one help me? my following code able to match <h3> tags and hiding it but not working properly. Please help me out. Code: function selectedOption() { var indx = newSel.selectedIndex; var selectedText = newSel.options[indx].text; h3Tag = document.getElementsByTagName("h3"); var nestedH3; //alert(h3Tag); bQuote = document.getElementsByTagName("blockquote"); for(var i=0; i<h3Tag.length; i++) { tagName[i]=h3Tag[i].innerHTML; if(selectedText != tagName[i] && selectedText != "Show All Lines") { //alert("Char: "+tagName[i]); h3Tag[i].style.display = "none"; bQuote[i].style.display = "none"; } else if(selectedText == "Show All Lines") h3Tag[i].style.display = "block"; } } I'm working on a greasemonkey script that requires me to append a tag before each instance of a tag with a specific class name. It works when there's no parent tags but when it goes into levels deep it doesn't work. So how can I use insertbefore?
Hi, How I get the images tags from an HTML page with Javascript (SRSc)? Regards FG Hello, I have a simple form with simple validation. I am just playing around a bit with forms and don't really have concrete knowledge. What I have done is created a form. Asking for first name, last name, age and email. When the user clicks the submit button I want 2 functions to run, the first checking the input is correct and also making sure all fields have a value. Once everything is checked and is O.K I want to go into another function which sends all this information to an array one by one. I am having difficulty accessing each individual input tag. I could achieve what I want to do, but it will take double the lines of code because each input has a different 'name'. So, what I am trying to do is access the input tags the same as you would do an array. Here is my code: HTML: Code: <form name="regForm" id="form"> <fieldset> <legend>Real Heroes - Registration Form</legend> <p>First Name:<input type="text" size="30" maxlength="20" name="txtFirstName" /></p> <p>Last Name:<input type="text" size="30" maxlength="20" name="txtLastName" /></p> <p>Age:<input type="text" size="30" maxlength="3" name="txtAge" /></p> <p>Email Address:<input type="text" size="30" maxlength="50" name="email" /></p> <p><input type="button" value="Submit Registration" name="butChkForm" onclick="callFuncs_onclick()" /> <input type="reset" value="Reset" name="resetForm" /></p> </fieldset> </form> JavaScript: Code: //CALLING THE FORM SCRIPTS// function callFuncs_onclick() { chkForm_onclick(); creatingDatabase_onclick(); } //**************FORM VALIDATION***************// function chkForm_onclick() { var theForm = document.regForm; if (theForm.txtFirstName.value == "" || theForm.txtLastName.value == "" || theForm.txtAge.value == "" || theForm.email.value == "") { alert("Please complete all of the form."); if (theForm.txtFirstName.value == "") { theForm.txtFirstName.focus(); } if (theForm.txtLastName.value == "") { theForm.txtLastName.focus(); } if (theForm.txtAge.value == "") { theForm.txtAge.focus(); } if (theForm.email.value == "") { theForm.email.focus(); } } else if (isNaN(theForm.txtAge.value)) { alert("That is not valid input for this field. Please re-enter your age."); theForm.txtAge.focus(); } else { alert("Thank you for completing the form, " + theForm.txtFirstName.value); } } function creatingDatabase_onclick() { var form = document.regForm; var index = form.input[0].value; alert(index); } I'm not quite sure where I am going wrong. Please note that these functions really labour the point, I know I have way too many lines of code but I am still very amateur with JS. Thank you for any help/information. Kind Regards, LC. |