Automatically update duplicate DIV's
Page 1 of 114 Replies - 668 Views - Last Post: 05 February 2013 - 07:44 AM
#1
Automatically update duplicate DIV's
Posted 23 January 2013 - 07:57 AM
Replies To: Automatically update duplicate DIV's
#2
Re: Automatically update duplicate DIV's
Posted 23 January 2013 - 08:02 AM
#3
Re: Automatically update duplicate DIV's
Posted 23 January 2013 - 08:04 AM
#4
Re: Automatically update duplicate DIV's
Posted 23 January 2013 - 09:51 AM
#5
Re: Automatically update duplicate DIV's
Posted 23 January 2013 - 01:14 PM
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Newcastle United Fansite</title>
<link rel="icon"
type="image/ico"
href="http://example.com/favicon.ico">
<link href="global.css" rel="stylesheet" type="text/css" />
<style type="text/css">
</style>
</head>
<body>
<div id="wrapper">
<div id="banner">
<ul id="sitetools">
<li><a href="#">Contact Us</a></li>
<li><a href="#">Subscribe</a> </li>
</ul>
</div>
<div id="tabs6">
<ul>
<li><a href="home.html" title="Home"><span>Home</span></a></li>
<li><a href="players.html" title="Current Players"><span>Squad</span></a></li>
<li><a href="fixtures.html" title="Next Fixtures"><span>Fixtures</span></a></li>
<li><a href="results.html" title="Past scores"><span>Results</span></a></li>
<li><a href="table.html" title="Current Standings"><span>Table</span></a></li>
</ul>
</div>
<div id="main">
<h1>Welcome to Newcastle United Fansite</h1>
<img src="images/70's logo.png" alt="70's logo" width="100" height="100" />
<br/><br/>
<p>Newcastle United Football Club (often abbreviated to NUFC) is an English professional association football club based in Newcastle upon Tyne, Tyne and Wear. The club was founded in 1892, by the merger of Newcastle East End and Newcastle West End, and has played at its current home ground, St James' Park, since.</p>
<p>The ground was developed into an all-seater stadium in the mid-1990s and now has a capacity of 52,404. The club has been a member of the Premier League for all but two years of the competition's history, and never dropped below the English football's second tier, since joining the Football League in 1893. In 2007, long term chairman and owner Sir John Hall sold his share in the club to Mike Ashley.</p>
<p>They have won four League Championship titles and six FA Cups, as well as the 1969 Inter-Cities Fairs Cup and the 2006 UEFA Intertoto Cup. Newcastle United has the ninth highest total of major honours won by an English club. The club's most successful period was between 1904 and 1910, when they won an FA Cup and three of their First Division titles.</p>
<p>They have a fierce local rivalry with Sunderland, and the two clubs have engaged in the Tyne-Wear derby since 1898. The club's traditional kit colours are black and white striped shirts, black shorts and black socks. Their traditional crest takes elements of the city coat of arms which features two seahorses.</p>
<source>wikipedia</source>
<h2 class="bullet">Newcastle Lose to Reading</h2>
<h2 class="bullet">Newcastle not fairing well in Transfer Market</h2>
<h2 class="bullet">"Money not the reason" states QPR Chairman</h2>
<h2 class="bullet">Newcastle lose out on French International Loic Remy </h2>
<br/>
</div>
<!--News Goes Here
-->
<div id="news">
<h2>News</h2>
<a href="#" class="story"><span class="title">Yanga-Mbiwa Signs</span>
Mapou Yanga-Mbiwa has joined Newcastle and has signed a 5 and a half year contract</a>
<a href="#" class="story"><span class="title">Mike Ashley to give 100% Backing </span>Mike Ashley will Give Alan Pardew transfer funds to bolster the squad </a>
<a href="#" class="story"><span class="title">Sloppy goals cost Newcastle <br />
</span>
Newcastle have now lost four of their last five and Alan Pardew feels the team need reinforcements during the transfer window. </a>
<a href="#" class="story"><span class="title">Haidara set for Newcastle?</span>
Newcastle have had a bid accepted for Nancy's Massadio Haidara </a>
<a href="#" class="story"><span class="title">Newcastle through to the last 32 of the Europa League</span>
Newcastle have progressed to the last 32 of the Europa League despite losing 2-0 in Bordeaux </a>
</div>
<div id="sidebar">
<div class="adv">
<a href="https://twitter.com/nufcfansite" class="twitter-follow-button" data-show-count="false">Follow @nufcfansite</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
<br/>
<!--Fixtures Goes Here
-->
<div id="minifixtures">
<h1>Upcoming Fixtures</h1>
<br/>
<p><img src="images/ball.png" alt="football" width="22" height="22" /> Villa (A)</p>
<br/>
<p><img src="images/ball.png" alt="football" width="22" height="22" /> Chelsea (H)</p>
<br/>
<p><img src="images/ball.png" alt="football" width="22" height="22" /> Tottenham (A)</p>
<br/>
<p><img src="images/ball.png" alt="football" width="22" height="22" /> Met'st Kharkiv (H)</p>
<br/>
<p><img src="images/ball.png" alt="football" width="22" height="22" /> Met'st Kharkiv (A)</p>
</div>
<!--Transfers Goes Here
-->
<div id="transfers">
<h1>Transfers</h1>
<br/>
<p><img src="images/Green-arrow-up.gif" alt="green arrow" width="22" height="22" /> IN</p>
<br/>
<p>Mathieu Debuchy - Lille</p><br/>
<p>Yanga-Mbiwa - Montpellier</p>
<br/>
<p><img src="images/Red-arrow-down.gif" alt="green arrow" width="22" height="22" /> OUT</p>
<br/>
<p>Demba Ba - Chelsea</p>
<p>Conor Newton - St. Mirren (loan until end of season)</p>br/>
<p>Bradden Inman - Crewe Alexandra (one-month loan)</p>br/>
<p>Curtis Good - Bradford City (one-month loan)</p>
</div>
</div>
</div>
<div id="legal"><p>Copyright 2013, newcastleunitedfansite.com</p>
<div id="sponsors">
<img src="images/sportsdirect.gif" alt="sports direct logo" /> <img src="images/virgin.png" alt="virgin logo" /> <img src="images/puma.gif" alt="puma logo" />
<p>Proud Sponsors of Newcastle United</p>
</div>
</div>
</div>
</body>
</html>
<!-- Hosting24 Analytics Code -->
<script type="text/javascript" src="http://stats.hosting24.com/count.php"></script>
<!-- End Of Analytics Code -->
so
<div id="news">is on everypage, I want to update the news div and when I do I want it to update every page.
#6
Re: Automatically update duplicate DIV's
Posted 23 January 2013 - 01:32 PM
#7
Re: Automatically update duplicate DIV's
Posted 01 February 2013 - 01:08 PM
Dormilich, on 23 January 2013 - 01:32 PM, said:
I used the PHP way as I have done that before but I may try to implement the Jquery way.
Thanks
#8
Re: Automatically update duplicate DIV's
Posted 05 February 2013 - 07:02 AM
I tried
<div id="transfers">
<script>$("#transfers").load("transfersscript.html"); </script>
</div>
and I included the library at the start of the page:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"></script>
but I get nothing in my DIV, have I placed it wrongly or have I made an error??
thanks
This post has been edited by Dormilich: 05 February 2013 - 07:04 AM
Reason for edit:: removed quote
#9
Re: Automatically update duplicate DIV's
Posted 05 February 2013 - 07:07 AM
if there were any error, you’d find that in the Error Console.
PS. jQuery 1.6.0 is rather old now, current version is 1.9.1
#10
Re: Automatically update duplicate DIV's
Posted 05 February 2013 - 07:16 AM
why is it placed after the DIV is closed?
after checking the error console I am getting the error:
XMLHttpRequest cannot load file:///F:/HTML%20website%20template/transfersscript.html. Origin null is not allowed by Access-Control-Allow-Origin.
not sure what that means! I haven't got the right privileges?
edit: just checked the error message online it needs to be put on a server like WAMp or something
This post has been edited by Addio569: 05 February 2013 - 07:17 AM
#11
Re: Automatically update duplicate DIV's
Posted 05 February 2013 - 07:21 AM
Addio569, on 05 February 2013 - 03:16 PM, said:
just to make sure.
Addio569, on 05 February 2013 - 03:16 PM, said:
XMLHttpRequest cannot load file:///F:/HTML%20website%20template/transfersscript.html. Origin null is not allowed by Access-Control-Allow-Origin.
not sure what that means! I haven't got the right privileges?
that means that you’re not allowed to request a file from the local file system. anyways, why would you do that in the first place? web sites are usually requested from a server (and file:/// tells me that you (most probably) loaded the file directly), so loading from a manually loaded file does not make much sense.
#12
Re: Automatically update duplicate DIV's
Posted 05 February 2013 - 07:21 AM
--allow-file-access-from-files
to its command-line.
#13
Re: Automatically update duplicate DIV's
Posted 05 February 2013 - 07:36 AM
Quote
I'm working off a memory stick so its just for testing.
Quote
--allow-file-access-from-files
to its command-line.
I did this and it works fine but only on one page. I have multiple pages with the same DIV and have added it exactly the same way, will it only work once??
#14
Re: Automatically update duplicate DIV's
Posted 05 February 2013 - 07:41 AM
Quote
Er, you're welcome.
Quote
Are you absolutely sure it is the same on each page..
This post has been edited by andrewsw: 05 February 2013 - 07:42 AM
#15
Re: Automatically update duplicate DIV's
Posted 05 February 2013 - 07:44 AM
Quote
sorry, wheres my manners, thank you.
Quote
I was missing
<script src="http://code.jquery.com/jquery-latest.js"></script>I only had:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js"></script>
that obviously makes a difference!
thanks for all your help!
|
|

New Topic/Question
Reply



MultiQuote



|