javascript - Problems with importing tumble-bar.html into index.html -
i'm trying import tumble-bar.html index.html using tumble-bar.js.
i'm using github, cannot use php's import.
index.html:
<!doctype html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/> <title>tumblegamer websearch</title> <link href='https://fonts.googleapis.com/css?family=oswald:400,300,700subset=latin,latin-ext' rel='stylesheet' type='text/css'> <link href='https://fonts.googleapis.com/css?family=droid+serif:400,400italic,700,700italic' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="i dont want advertise/stylesheets/style.css"> <link rel="stylesheet" href="i dont want advertise/stylesheets/tumble-bar.css"> <script type="text/javascript" src="http://code.jquery.com/jquery-/*i dont know version use*/.js"></script> <script src="i dont want advertise/javascript/tumble-bar.js"></script> <!-- put following javascript before closing </head> tag. --> <script> (function() { var cx = 'i dont want advertise'; var gcse = document.createelement('script'); gcse.type = 'text/javascript'; gcse.async = true; gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//cse.google.com/cse.js?cx=' + cx; var s = document.getelementsbytagname('script')[0]; s.parentnode.insertbefore(gcse, s); })(); </script> </head> <body> <div class="content"> <center> <header> <div class="tumble"></div><!-- want put tumble-bar.html here --> </header> <main> <img class="logo" src="i dont want advertise"> <gcse:searchbox-only></gcse:searchbox-only> <br> <br> <br> <br> <p><strong>new:</strong><a href="i dont want advertise">alpha test tumble netbrowse</a>.</p> </main> <footer> © 2015 tumblegamer - <a href="i dont want advertise">tumblegamer home</a> - <a href="i dont want advertise">about tumblegamer</a> - tumble netsearch alpha (<a href="i dont want advertise">about</a>) </footer> </center> </div> </body> </html>
tumble-bar.html:
<navbar class"tumblebar"> <center> <ul> <li><a href="i dont want advertise" class="active">search</a></li> <li><a href="i dont want advertise">blog</a></li> <li><a href="i dont want advertise">youtube</a></li> <li><a href="i dont want advertise">downloads</a></li> <li><a href="i dont want advertise">mail</a></li> <li><a href="#">social ▼</a> <ul class="submenu"> <li><a href="i dont want advertise">facebook</a></li> <li><a href="i dont want advertise">twitter</a></li> <li><a href="i dont want advertise">google+</a></li> <li><a href="i dont want advertise">twitch</a></li> </ul> </li> </ul> </center> </navbar>
can me importing tumble-bar.html <div class="tumble"></div>
, tell me <script></script>
command of version of jquery using?
simply $().load()
html.
$('.tumble').load('tumble-bar.html', function () {/* callback if needed */});
you can find $(document).load(function () {})
. it's different function, because execute function
when document loaded.
difference between calls in first 1 pass string url.
about jquery version:
1.*
version support older ie browsers , slower.
2.*
has thrown old ie support , has more improvements.
for fresh start use 2.*
version. if have old code, use same jquery code.
Comments
Post a Comment