JavaScript - Showing Link On Only One Url Of A Typepad Blog?
I am a blogger but not a programmer. However, I have an advertiser that wants to pay me for a link that only appears on my blog "home" page (or main landing URL), but not on any of the individual blog post pages. This is the code that I got from Typepad, my blog hosting company:
Code: <div id="displayAdDiv" style="display:none;"> <a href="http://www.advertiserwebpage.com">Advertiser</a> </div> <script language="javascript"> var AdDiv = document.getElementById("displayAdDiv"); if ( window.location == "http://www.bloghomepage.com/" ) { AdDiv.style.display="block"; } else { AdDiv.style.display="none"; } </script> This works as expected (i.e., the link only appears on the main page). However, the advertiser now says that in addition to not having the link show up anywhere else but on the home page, they don't want the advertiser link page URL appearing in the source code for any other page of my blog but the home page. I'm assuming that this whole thing has something to do with SEO, but I can't say for sure. Anyway, I'm not even sure this is possible using javascript, but I was wondering if there is a way to: a) read or "call" the link from another file (e.g., txt, js, xml), or possibly even concatenate two or more variables on the fly so that it only shows up in the source code associated with the home page URL; and, b) only display the link to visitors to the home page URL. As a point of reference, the advertiser did show me how the coding was done for another blogging platform, Wordpress: Code: <?php if ($_SERVER["REQUEST_URI"] == "/" || $_SERVER["REQUEST_URI"] == "/index.php") { ?> Advertising link goes here... <?php } ?> OR the following widget: It is called the widget-context plugin. Go to plugins -> add new searched for - widget context - and install it. Again, I am not a programmer, but I get the distinct impression that this approach would not work with Typepad (because they don't use PHP and/or allow users to do things that affect code on the server side?). Any help would be appreciated! Similar TutorialsI am having trouble with a script that works with the link invisibly which you can see the cursor change to a pointer hand when hovering next to "Email:". If I copyed and pasted the script below Code: <script language=JavaScript> <!-- var user = "name"; var host = "domain.com"; var link = user + "@" + host; document.write("<a hre" + "f=ma" + "ilto:" + user + "@" + host + ">" + link + "</a>"); //--> </script> It would show if you placed the script in the body portion of a blank HTML page. In my website below I can't figure out why the link doesn't show and is invisible. Any suggestions on how to fix this? This emailHide.html.txt file is below, to view in HTML remove the .txt extention and save and view in browser. I've recently started coding Html and Javascript and im wondering how to write a Script to create a new blog page without having to manually start from a blank document everytime
I am building a website and on my homepage there is a small section where I want recent blogs to be posted. Of course I want a page for blogging also. Can anyone help me on how to do this? Thanks I am trying to use two jquery on a blog... Code is as follows... (I am getting error on page as "Object doesnt support this property or method") (For MORE plz visit my page www.technotreat.com) <Head> <script src='jquery.lavalamp.min.js' type='text/javascript'/> <script src='jquery.lavalamp.js' type='text/javascript'/> <script src='interface.js' type='text/javascript'/> <script src='jquery.js' type='text/javascript'/> $(function() { $("#3".lavaLamp( { fx: "backout", speed: 700, }); }); </script> </Head> <Body> . . . . . . <div class='dock' id='dock2' style='position: absolute; align: center;'> <div class='dock-container2'> <a class='dock-item2' href='#'><span>Home</span><img alt='home' src='home.png'/></a> . . . . . . </div> </div> <script type='text/javascript'> $(document).ready( function() { $('#dock2').Fisheye( { maxWidth: 60, items: 'a', itemsText: 'span', container: '.dock-container2', itemWidth: 40, proximity: 80, alignment : 'left', valign: 'bottom', halign : 'center' }); } ); </script> </Body> Both jquery used are for Menus... One is below head (slider style) and another one is floating (floating MAC Menu style)... Plz scroll page and hover on below menu, then you will feel the difference in IE and FF (chrome)... Give me solution which fits for all browsers... THANKS A LOT Hi everybody. I need some help too build a poll with 2 answer option people can select and 5 rating stars . something like this 1. Yes you're bad (344567)| 2.No you're good (5676)| Here 5 stars they can rate. the numbers stand for how much people clicked on that option But it is a blog with wordpress system . But every story need there own poll. And i m not a expert in xml or what other system i need to build this . Can somebody help me. Thank you. Sorry for my poor english Hello, Ive used feed.informer to display recent updates to my blog but it only seems to allow for them to be displayed vertically. I am looking for a way to display my recent blog posts horizontally on my site in a manner similar to how feed.informer works. Thank you for your help! i need blog popup java script can help me? i have premium account blog and i use some adf.ly links so i need auto popup window java script!
As part of course work for class I must write JavaScript/XML (with CSS) to carry out the following tasks. In essence it is a micro version of twitter. Users must be able to login, make posts, edit them. A text box should appear, with reset/update buttons. When the Update button is clicked the following occurs: 1. The user name is added to the message text typed by the user 2. A time stamp is added after the message text 3. A photo is added at the left 4. Any URLs are made into hyperlinks 5. The combined photo and text, formatted suitably, is prepended to the list of previous messages below the input area, i.e. the most recent item is at the top of the places visited. 6. The message box is cleared to allow further user input. - When the Clear button is clicked the text area is cleared. Additionally 1. Using a manually created XML file users must be able to "register themselves" 2. Posts must be manually saved in an XML file which loads upon login 3. When anyone opens the default page they are presented with a list of all your journey and comments (retrieved from the server). 4. Allow a registered user who has logged in to add, delete or modify only their comments. 5. Use one or more XML files to record registered users and passwords as well as posts and comments. These are manually created in 1& 2 above. ---- I initally tackled the first section using innerHTML and other various Javascript components but am at a total loss as to how to achieve the same thing using nodes (and XML). Any help with regards with where to begin would be much appreciated. I have searched wide and far for something like this. Thought I would find it because it is something that has become quite big these days - split testing. Possibly some php to put in the head that would open and get a value from a text file. myfile.txt Inside the myfile.txt file is either a 1 or a 0. Each time it is opened to read/write, it switches... 1 for 0, or 0 for 1. A switch or toggle. Then in the body, javascript only (cannot use php in the body because I want to be able to add javascript into a wordpress or similar blog post) and a value could be sent from the php in the head (hardcoded) to the javascript... IF the var is 1, then "http://linkA.php" ELSE "http://linkB.php" The php can read (get the number in the myfile.txt), then write with the other - 1 or 0. No matter what page I add the js script to, each post can use the php code values in the <head> / the myfile.txt file. This seems like it should be straight forward, and I know it can get a little more involved if we first check for a file, and if no exist, then create... Thank you, Steve I'm working on a technical document that has a glossary section. When I use a technical term, I link to its definition in the glossary then provide a return link to return the user to whence they came. But if I use that same term again, and if I want to link it to the glossary, I need to duplicate the glossary entry in order to provide a return link that returns them to the right place. Is there some way I could link them to the glossary and embed a unique return link in the link to the glossary?
I've been using this slidehsow but each time I click on a link (Newsflash) it goes to yahoo.com, even though each link goes to a different website, it looks like the last link of the last slidehsow is the one which controls all the slidehsow links link of slidshow as you can see from the code each link for each slidehsow should go to a diffrent website. Code: <div class="lof-main-outer"> <ul class="lof-main-wapper"> <li> <img src="images/791902news3.jpg" title="Newsflash 2" height="300" width="900"> <div class="lof-main-item-desc"> <h3><a target="_parent" title="Newsflash 2" href="http://www.google.com">Newsflash 2</a></h3> <p>The one thing about a Web site, it always changes! Joomla! makes it easy to add Articles, content,...</p> </div> </li> <li> <img src="images/435576news10.jpg" title="Newsflash 1" height="300" width="900"> <div class="lof-main-item-desc"> <h3><a target="_parent" title="Newsflash 1" href="http://www.gmx.com">Newsflash 1</a></h3> <p>Joomla! makes it easy to launch a Web site of any kind. Whether you want a brochure site or you are...</p> </div> </li> <li> <img src="images/641906img1.jpg" title="Newsflash 3" height="300" width="900"> <div class="lof-main-item-desc"> <h3><a target="_parent" title="Newsflash 3" href="www.godaddy.com">Newsflash 3</a></h3> <p>With a library of thousands of free Extensions, you can add what you need as your site grows. Don't...</p> </div> </li> <li> <img src="images/416719news7.jpg" title="Newsflash 5" height="300" width="900"> <div class="lof-main-item-desc"> <h3><a target="_parent" title="Newsflash 5" href="http://www.flickr.com">Newsflash 5</a></h3> <p>Joomla! 1.5 - 'Experience the Freedom'!. It has never been easier to create your own dynamic Web...</p> </div> </li> <li> <img src="images/416719news7.jpg" title="Newsflash 5" height="300" width="900"> <div class="lof-main-item-desc"> <h3><a target="_parent" title="Newsflash 5" href="http://www.intel.com">Newsflash 5</a></h3> <p>Joomla! 1.5 - 'Experience the Freedom'!. It has never been easier to create your own dynamic Web...</p> </div> </li> <li> <img src="images/416719news7.jpg" title="Newsflash 5" height="300" width="900"> <div class="lof-main-item-desc"> <h3><a target="_parent" title="Newsflash 5" href="http://www.yahoo.com">Newsflash 5</a></h3> <p>Joomla! 1.5 - 'Experience the Freedom'!. It has never been easier to create your own dynamic Web...</p> </div> </li> </ul> </div> thanks this problem has been solved
The alert at the top of this function will not show... Code: function getXmlHttpRequestObject() { alert("HTTP XML REQUEST!"); var httpxml; if (window.XMLHttpRequest) { // code decent browsers like Firefox, Chrome, Opera, Safari. And IE7+... httpxml = new XMLHttpRequest(); return httpxml; } else { if (window.ActiveXObject) { //Code for crap like IE httpxml = new ActiveXObject('Microsoft.XMLHTTP'); return httpxml; } else { httpxml = null; } } if (httpxml == null) { document.getElementById('p_status').innerHTML = "Status: Could not create XmlHttpRequest Object, please upgrade your browser!"; return null; } else { return httpxml; } Hi, I have the following codes but my checkbox is not appearing. The values of the checkbox do print out in the alert. Can anyone tell me what is wrong with it? Thank you! Code: var table = document.getElementById('maintable'); var i; // iterator var item; // pointer to item in received list for(i = 0; (item = contacts.ReturnValue.getNext()) != undefined; ++i) { table.insertRow(i + 1); var result = "<td>"; if(item.FirstName != undefined) { result += item.FirstName.Value; } result += "</td><td>"; if(item.LastName != undefined) { result += item.LastName.Value; } result += "</td><td>"; if(item.MobilePhoneGen != undefined) { result += item.MobilePhoneGen.Value; } result += "</td><td>"; if(item.EmailGen != undefined) { result += item.EmailGen.Value; } var td1 = document.createElement("td"); var chkbox = document.createElement('input'); chkbox.type='Checkbox'; table.rows[i + 1].innerHTML = result; chkbox.value=item.MobilePhoneGen.Value; td1.appendChild(chkbox); alert(chkbox.value); } i've been having some trouble with showing images and i think it's a problem with the image source, i would like to know how i must alter my code to fix this thnx. i should also point out that the images are the 6 sides of a dice Code: <html> <head> <title>My Script</title> <script type = "text/javascript"> if (document.images) { image1 = new Image(10,10); image1.source = "d1.gif"; image2 = new Image(10,10); image2.source = "d2.gif"; image3 = new Image(10,10); image3.source = "d3.gif"; image4 = new Image(10,10); image4.source = "d4.gif"; image5 = new Image(10,10); image5.source = "d5.gif"; image6 = new Image(10,10); image6.source = "d6.gif"; } alert(image1); alert(image2); alert(image3); alert(image4); alert(image5); alert(image6); </script> </head> <body> </body> </html> I am supposed to create a calendar and have the calendar show up in the top right of the screen while also highlighting the current date set on it. Nothing shows up... HTM: Code: <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <!-- New Perspectives on JavaScript, 2nd Edition Tutorial 3 Tutorial Case The Chamberlain Civic Center Author: Date: Filename: ccc.htm Supporting files: back.jpg, calendar.css, calendar.js, ccc.css, ccc.jpg, logo.gif --> <title>The Chamberlain Civic Center</title> <link href="ccc.css" rel="stylesheet" type="text/css" /> <link href="calendar.css" rel="stylesheet" type="text/css" /> <script src="calendar.js" type="text/javascript"></script> </head> <body> <div id="head"> <script type="text/javascript"> calendar("March 25, 2011"); </script> <img src="ccc.jpg" alt="Chamberlain Civic Center" /> </div> <div id="links"> <table><tr> <td><a href="#">Home</a></td><td><a href="#">Tickets</a></td> <td><a href="#">Events</a></td><td><a href="#">Tour</a></td> <td><a href="#">Directions</a></td><td><a href="#">Hours</a></td> <td><a href="#">Packages</a></td><td><a href="#">Contact Us</a></td> </tr></table> </div> <div id="main"> <p id="firstp"><img src="photo.jpg" alt="" />March is another banner month at the Chamberlain Civic Center, with performances of the award-winning musical, <span>The Producers</span> by the Broadway Touring Company on March 4, 5, and 6. Tickets are going fast, so order yours today.</p> <p>Celebrate the season on March 11 with the Chamberlain Symphony and their special selection of classical music with Spring themes. The next day, March 12, exercise your mind by attending the Charles Dickens mystery <span>Edwin Drood</span>.</p> <p>Jazz lovers have a lot to celebrate in March with a visit from <span>The Jazz Masters</span> on the 17th. Then on March 24, enjoy the music of The Duke with <span>An Ellington Tribute</span> performed by the Jazz Company of Kansas City.</p> <p>Pins, bottles, plates, and chairs are flying at the Chamberlain Civic Center in March. <span>The Taiwan Acrobats</span> return with another amazing performance on Sunday, March 13. On March 20, the <span>Madtown Jugglers</span> get into the act with their unique blend of comedy, juggling, and madness.</p> <p>Enjoy a classical brunch every Sunday afternoon with music provided by the Carson Quartet. Seating is limited, so please reserve your table.</p> </div> <address> The Chamberlain Civic Center · 2011 Canyon Drive · Chamberlain, SD 57325 · (800) 555-8741 </address> </body> </html> Java Code: /* New Perspectives on JavaScript, 2nd Edition Tutorial 3 Tutorial Case Author: Date: Function List: calendar(calendarDay) Creates the calendar table for the month specified in the calendarDay parameter. The current date is highlighted in the table. writeCalTitle(calendarDay) Writes the title row in the calendar table writeDayTitle() Writes the weekday title rows in the calendar table daysInMonth(calendarDay) Returns the number of days in the month from calendarDay writeCalDays(calendarDay) Writes the daily rows in the calendar table, highlighting calendarDay */ function calendar(calendarDay) { if (calendarDay == null) calDate=new Date() else calDate = new Date(calendarDay); document.write("<table id='calendar_table'>"); writeCalTitle(calDate); writeDayNames(); writeCalDays(calDate); document.write("</table>"); } function writeCalTitle(calendarDay) { var monthName = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "Octoboer", "November", "December"); var thisMonth=calendarDay.getMonth(); var thisYear=calendarDay.getFullYear(); document.write("<tr>"); document.write("<th id='calendar_head' colspan='7'>"); document.write(monthName[thisMonth]+" "+thisYear); document.write("</th>"); document.write("</tr>"); } function writeDayNames() { var dayName = new Array ("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"); document.write("<tr>"); for (var i=0; i < dayName.length; i++) { document.write("<th class='calendar_weekdays'> "+dayName[i]+"</th>"); } document.write("</tr>"); } function daysInMonth(calendarDay) { var thisYear = calendarDay.getFullYear(); var thisMonth = calendarDay.getMonth(); var dayCount = new Array (31,28,31,30,31,30,31,31,30,31,30,31); if (thisYear % 4 == 0) { if ((thisYear % 100 != 0) || (thisYear % 400 == 0)) { dayCount[1] = 29; } } return dayCount[thisMonth]; } function writeCalDays(calendarDay) { var currentDay = calendarDay.getDate(); var dayCount = 1; var totalDays = daysInMonth(calendarDay); calendarDay.setDate(1); var weekDay = calendarDay.getDay(); document.write("<tr>"); for (var i=0; i < weekDay; i++) { document.write("<td></td>"); } while (dayCount <= totalDays) { if (weekDay == 0) document.write("<tr>"); if (dayCount == currentDay) { document.write("<td class='calendar_dates' id='calendar_today'>"+dayCount+"</td>"); } else { document.write("<td class='calendar_dates'>"+dayCount+"</td>"); } if (weekDay == 6) document.write("</tr>"); dayCount++; calendarDay.setDate(dayCount); weekDay = calendarDay.getDay(); } document.write("</tr>"); } CSS (calendar) Code: /* New Perspectives on JavaScript, 2nd Edition Tutorial 3 Tutorial Case Filename: calendar.css This file contains styles applied to the calendar table */ #calendar_table {float: right; background-color: white; font-size: 9pt; font-family: Arial, Helvetica, sans-serif; border-style: outset; border-width: 5px; margin: 0px 0px 5px 5px} #calendar_head {background-color: rgb(223,29,29); color: ivory; letter-spacing: 2px} .calendar_weekdays {width: 30px; font-size: 10pt; border-bottom-style: solid} .calendar_dates {text-align: center; background-color: white} #calendar_today {font-weight: bold; color: rgb(223,29,29); background-color: ivory; border: 1px solid black} CSS (page) Code: /* New Perspectives on JavaScript, 2nd Edition Tutorial 3 Tutorial Case Filename: ccc.css This file contains styles used in the ccc.htm file */ body {margin: 0px; background: white url(back.jpg) repeat-y scroll 820px 0px} #head {width: 750px; height: 150px; padding: 5px} #links {clear: right; width: 750px; padding: 0px} #links table {width: 750px; font-family: Arial, Helvetica, sans-serif; font-size: 8pt; margin: 0px} #links table td {text-align: center; background-color: white; border: 1px solid black; letter-spacing: 5; padding: 2px} #links table a {text-decoration: none; color: rgb(223,29,29); width: 100%} #links table a:hover {color: white; background-color: rgb(223,29,29)} #main {width: 750px; font-family: Arial, Helvetica, sans-serif; padding: 10px} #main p {text-align: justify; font-size: 9pt} #firstp:first-line {font-variant: small-caps} #main img {float: right; margin: 0px 0px 10px 10px} #main p span {color: rgb(223,29,29)} address {width: 750px; font-size: 8pt; font-style: normal; color: rgb(223,29,29); font-family: Arial, Helvetica, sans-serif; text-align: center; border-top: 1px solid rgb(223,29,29); padding-bottom: 10px} Can anyone see something wrong? This is really frustrating me as I'm not very good with javascript but thought I did this one right... i am having some problem showing and hiding some div i want to show the div with the id="universitiesDiv" on one point and the div id="highSchoolsDiv" on another depending on the user choice of selected option. Code: function Show (titleImg){ // the id of the content element from the id of the title element var contentID = titleImg.id.replace (/title/, "content"); var contentDiv = document.getElementById (contentID); contentDiv.style.display = "block"; return false; } function Hide (titleImg){ // the id of the content element from the id of the title element var contentID = titleImg.id.replace (/title/, "content"); var contentDiv = document.getElementById (contentID); contentDiv.style.display = "none"; return false; } the functions work fine i have tested them on input type="checkbox" and they work fine Code: <select name="education" id="education" onfocus="Show(this.options[this.selectedIndex].value);"> <option selected value="00">-الرجاء الاختيار-</option> <option value="highSchoolsDiv">مدرسة ثانوية</option> <option value="universitiesDiv"> كلية </option> <option value="universitiesDiv">درجة البكالوريوس</option> <option value="universitiesDiv">درجة عليا</option> <option value="universitiesDiv">دكتوراه / ما بعد الدكتوراه</option> <option value="07">اسألني فيما بعد</option> </select> </span> </div> </td></tr></table> </div> <div> <div class="Left"></div> <table class="step2" ><tr><td> <div class="Right"> <div class="Inner" id="Inner"> <div id="universitiesDiv" class="Row innerError" style="display:none;"> <div class="Left"> <label for="universities">الجامعة / الكلية</label></div> <div class="Right"> <input type="text" name="universities" id="universities" class="text" autocomplete="off" onfocus="focusInput(this);" onchange=" validate_JoinPersonalInfoForm_universities();" onblur="blurInput(this); validate_JoinPersonalInfoForm_universities();" size="55"/> </div> </td></tr><tr><td> </div> <div id="highSchoolsDiv" class="Row innerError" style="display:none;"> <div class="Left"> <label for="high_schools">المدرسة الثانوية</label></div> <div class="Right"> <input type="text" name="high_schools" id="high_schools" class="text" autocomplete="off" onfocus="focusInput(this);" onchange=" validate_JoinPersonalInfoForm_high_schools();" onblur="blurInput(this); validate_JoinPersonalInfoForm_high_schools();" size="55"/> </div> </div> </div> </div> </td></tr></table> </div> here is doesn't do nothing i have tried onblur onfocus onchange onselect everything i even tried then in side the option <option onselect... !!!!! anyone can help me, that would be great thanks |