Forum » Server-Side scripting » Page Reload
MLormans.com
Berichten: 174
avatar
Offline Stuur privebericht
Beste CriminalsLeden,

Ik ben nog altijd bezig met mijn YouTube Script voor mijn Portfolio.
Inmiddels ben ik zover dat hij ingebouwd is en (enigszins) naar behoren werkt.
Het klikken op andere filmpjes etc werkt allemaal prima:
http://mlormans.com/filmpjes.html

Echter als je op een video klikt om deze te bekijken herlaad hij de pagina (geen probleem)
maar dan herlaad hij ook het Header gedeelte van me website.
Hier volgt het javascript wat dit alles moet regelen:

Code | Selecteer Alles
minimaliseren
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/**
 * Zend Framework
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://framework.zend.com/license/new-bsd
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@zend.com so we can send you a copy immediately.
 *
 * @category   Zend
 * @package    Zend_Gdata
 * @subpackage Demos
 * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */

/**
 * @fileoverview Provides functions for browsing and searching YouTube 
 * data API feeds using a PHP backend powered by the Zend_Gdata component
 * of the Zend Framework.
 */

/**
 * provides namespacing for the YouTube Video Browser PHP version (ytvbp)
 */
var ytvbp = {};

/**
 * container div id used to hold the video player
 * @type String
 */
ytvbp.VIDEO_PLAYER_DIV 'videoPlayer';

/**
 * Sends an AJAX request to the server to retrieve a list of videos or
 * the video player/metadata.  Sends the request to the specified filePath
 * on the same host, passing the specified params, and filling the specified
 * resultDivName with the resutls upon success.
 * @param {String} filePath The path to which the request should be sent
 * @param {String} params The URL encoded POST params
 * @param {String} resultDivName The name of the DIV used to hold the results
 */
ytvbp.sendRequest = function(filePathparamsresultDivName) {
  if (
window.XMLHttpRequest) {
    var 
xmlhr = new XMLHttpRequest();
  } else {
    var 
xmlhr = new ActiveXObject('MSXML2.XMLHTTP.3.0');
  }
        
  
xmlhr.open('POST'filePathtrue);
  
xmlhr.setRequestHeader('Content-Type''application/x-www-form-urlencoded'); 

  
xmlhr.onreadystatechange = function() {
    var 
resultDiv document.getElementById(resultDivName);
    if (
xmlhr.readyState == 1) {
      
resultDiv.innerHTML '<b>Loading...</b>'
    } else if (
xmlhr.readyState == && xmlhr.status == 200) {
      if (
xmlhr.responseText) {
        
resultDiv.innerHTML xmlhr.responseText;
      }
    } else if (
xmlhr.readyState == 4) {
      
alert('Invalid response received - Status: ' xmlhr.status);
    }
  }
  
xmlhr.send(params);
}

/**
 * Uses ytvbp.sendRequest to display a YT video player and metadata for the
 * specified video ID.
 * @param {String} videoId The ID of the YouTube video to show
 */
ytvbp.presentVideo = function(videoId) {
  var 
params 'queryType=show_video&videoId=' videoId;
  var 
filePath 'movies.php';
  
ytvbp.sendRequest(filePathparamsytvbp.VIDEO_PLAYER_DIV);
}


Ikzelf denk dat het hem in de: ytvbp.sendRequest functie zit.
Echter heb ik 0,0 verstand van javascript. Vandaar hier de vraag of iemand even zo aardig zou kunnen/willen zijn om dit (proberen) op te lossen.
Laatst gewijzigd door Tieske op 2011-11-16 19:08:57
16-11-2011 18:21
Dit topic is 163 keer bekeken door 28 verschillende leden
Reacties op: "Page Reload"
1
MLormans.com
Berichten: 174
avatar
Offline Stuur privébericht
Kon geen Nieuw Topic aanmaken + het vorige had ik opgelost Dus vandaar het oude topic omgevormd tot mijn nieuwe vraag.

Ookdit weer opgelost, door natedenken wat er vanmiddag steeds gebeuren.
En dus opgelost door een (normaal gezien) super foutieve manier.

He header 'info' in de functie gezet die de Video Toont, zodat dit niet nogmaals op de pagina geplaatst wordt bij het aanklikken van de volgende pagina,

aub.
16-11-2011 18:44
Informatica Student
Berichten: 1406
avatar
Offline Stuur privébericht
Dit is javascript, geen Java
16-11-2011 20:52
<?/ $me=Android ?>
Berichten: 1719
avatar
Online Stuur privébericht
Dat weet de TS wel, zie zijn post...
16-11-2011 22:50
Reageer op: "Page Reload"
1
Je kan niet reageren omdat je niet bent ingelogd. Inloggen of Aanmelden