<b>REGISTER</b>

GFX-Sector - Javascript & jQuery


 
GFX-Sector » Coding Area » Webentwicklung » Javascript & jQuery » Der Code klappt nicht, woran kann das liegen? » Hello Guest [Login|Register]
Last Post | First Unread Post Print Page | Recommend to a Friend | Add Thread to Favorites

Javascript & jQuery

Probleme, Fragen oder sonstiges mit JavaScript, jQuery und co? Hier bist du richtig!
Post New Thread Post Reply

Der Code klappt nicht, woran kann das liegen?

     Deutsche Version  English version
Author
Post « Previous Thread | Next Thread »

maximadeone maximadeone is a male
Abwedler


maximadeone hat kein Avatar

Registration Date: 10.11.2009
Posts: 179
Location: Remscheid
Program: Photoshop CS3, Illustrator CS3

Spacer
Der Code klappt nicht, woran kann das liegen?

Der Code klappt nicht, woran kann das liegen?

      

Hallo,

ich hoffe das steht noch nirgendwo.

Ich hab einen alten Code gefunden und möchte die iframes mit neuen Alternativen ersetzen. Ich hab gelesen das es mit jQuery klappt!? Kann mir da jemand helfen?



code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="style.css">
<title>maximade</title>
<style type="text/css">
</style>
</head>
<body>
<div id="content1"><iframe id="content1frame"></iframe></div>
<div id="content2"><iframe id="content2frame"></iframe></div>
<div id="navigation"> <a href="start.html" target="content2frame">Start</a>
<a href="%FCberuns.html" target="content2frame">Über uns</a> |
<a href="kontakt.html" target="content1frame">Kontakt</a> | <a
href="impressum.html" target="content1frame">Impressum</a>
</div>
</body>
</html>



Sollte es andere Möglichkeiten geben oder sonstige Verbesserungsvorschläge immer her damit!!


Danke im voraus!


"keep it simple and stupid."

This post has been edited 1 time(s), it was last edited by maximadeone: 30.07.2011 15:35.

Der Code klappt nicht, woran kann das liegen? 29.07.2011 19:27 maximadeone is offline Search for Posts by maximadeone

ClOuDy. ClOuDy. is a male
Pfadfinder


Avatar von ClOuDy.

Registration Date: 31.01.2010
Posts: 566
Program: PS CS5

Spacer
      

google ist dein freund

http://tinyurl.com/3uqawck



Der Code klappt nicht, woran kann das liegen? 29.07.2011 19:33 ClOuDy. is offline Search for Posts by ClOuDy.

maximadeone maximadeone is a male
Abwedler


maximadeone hat kein Avatar

Registration Date: 10.11.2009
Posts: 179
Location: Remscheid
Program: Photoshop CS3, Illustrator CS3

Thread Starter Thread Started by maximadeone
Spacer
      

Edit:

Danke Dir! Ich hab jetzt ein Tutorial gefunden welches mir weiterhilft.
Jedoch hab ich jetzt ein Problem und zwar habe ich es wie hier beschrieben versucht umzusetzen.


Jedoch lädt er nicht den Inhalt der .html Datein.

Hier mein Code:


index.html
code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<title>maximade</title>
<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="ajax.js"></script>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="navigation"> <a href="eins.html">Seite 1</a> | <a
href="zwei.html">Seite 2</a>
</div>
<div id="content1"> </div>
<div id="content"> </div>
</body>
</html>


ajax.js

code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
// code direkt nach seitenaufbau starten
$(document).ready(function()
{
   // allen links im div 'navigation' eine click()-funktion zuweisen
   // es wird auch auf alle links von der dynamisch nachgeladenen
   // seiten reagiert (solange die seiten in das content-div geladen werden)!
   $("#navigation a, #content a").live("click",function()
   {
	// das link-ziel jeweils auslesen & zwischenspeichern
	var pageToLoad = $(this).attr("href");
	// varaible für den neuen inhalt
	var pageContent;
 
	// die externe seite laden, der inhalt ist dann in 'data'
	$.get(pageToLoad, function(data)
	{
	   // den inhalt zwischenspeichern
	   pageContent=data;
 
	   // content-div langsam ausblenden
	   $("#content").fadeOut("slow", function()
	   {
		// wenn das ausblenden fertig ist, inhalt an das content-div übergeben
		$("#content").html(pageContent);
		// content-div langsam wieder einblenden lassen
		$("#content").fadeIn("slow");
 
		// oder in kurzer form (vorzuziehen)
		// $("#content").html(pageContent).fadeIn("slow");
	   });
	});
 
	// wichtig! sonst wird der a-link im browser aufgerufen!
	return false;
});
});



Ich hoffe jemand kann mir sobald wie möglich helfen!!

Danke!



"keep it simple and stupid."

This post has been edited 1 time(s), it was last edited by maximadeone: 29.07.2011 21:15.

Der Code klappt nicht, woran kann das liegen? 29.07.2011 19:37 maximadeone is offline Search for Posts by maximadeone
 
Spacer
   
GFX-Sector
unregistered


 hat kein Avatar


Spacer

Have you enjoyed this topic?


If you were enjoying this post and if you keen on reading more interesting stuff then do not hesitate to complete the free sign up.

After the free registration you will gain access to all areas and you will be able to communicate with other artists from all over the world.

In addition you will benefit from our Photoshop and coding section as well as from our huge (hundreds of gigabytes) free resource section where you can find everything you will need to be a successful (web) designer/artist.

Sign up now and enjoy the advantages as a registered member.

(This website will be ad-free after a complete free sign up.)

New Post 29.07.2011 19:37  
Tree Structure | Board Structure
Post New Thread Post Reply
GFX-Sector » Coding Area » Webentwicklung » Javascript & jQuery » Der Code klappt nicht, woran kann das liegen?

Similar topics to Der Code klappt nicht, woran kann das liegen?
Thread
Leon der Profi | Filmcover (Forum: Zeichnungen)
Suche guten Coder! (Forum: Archiv)
Meine aller ersten Bilder mit Photoshop! (Forum: Sonstiges)
Neue Ideen braucht das Forum (Forum: Feedback)
[Real] Real Render Test (Forum: Signaturen/Avatare)