Jump to content

edg322

Members
  • Posts

    27
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

edg322's Achievements

Member

Member (2/5)

0

Reputation

  1. ok I got a solution worked out. If you add the current time at the end of the URL string being called, that will force IE to get the fresh page (instead of grabbing cached content) Change the getPage function to getPage("get_images.cfm?ts=") And add into the js: var now = new Date(); var url = thePageToGet + now.getTime(); This way instead of IE looking to refresh just "get_images.cfm" it's now looking to refresh "get_images.cfm?ts=1182352248509" which will of course change every time.
  2. Here's the code: Code: function GetXmlHttpObject() { var xmlHttp=null; try {xmlHttp=new XMLHttpRequest();} catch(e) { try {xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");} catch(e) {xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");} } return xmlHttp; } function getPage(thePageToGet) { xmlHttp=GetXmlHttpObject(); if(xmlHttp==null) {alert("Your browser doesn't support AJAX!");return;} var url = thePageToGet; xmlHttp.onreadystatechange=stateChanged; xmlHttp.open("GET",url,true); xmlHttp.send(null); } function stateChanged() { if(xmlHttp.readyState==4) { if (xmlHttp.responseText) { document.getElementById("featured_area").innerHTML=xmlHttp.responseText; t=setTimeout('getPage("get_images.cfm")',5000); } } } like I said, very basic script. There's a span tag on my page called "featured_area" and that content should be refreshed from the contents of 'thePageToGet' which is just dynamically grabbing some images and the urls they link to: Code: <span id="featured_area"> <script> getPage("get_images.cfm") </script> </span>
  3. My problem has to do with AJAX/js and innerHTML in IE. I have a very basic AJAX script that calls a file which should display fresh content every few seconds. All this is within div tags on my main page. It works fine in FF of course. It also works in IE if you have Tools-> Internet options -> Settings "Check for newer versions of stored pages" set to "Every visit". If you change that to "Automatically" then it breaks. Actually if you change it to anything other than the "Every visit" it doesn't work. Apparently Microsoft caches in the temp files every GET request. Well guess what, I change the AJAX call to POST and it's the same problem. So the POST option is out. I also can't ask users to change their browser settings. I also can't change my meta tags, which I believe has an option somewhere to force a new page. So I'm wondering if there is a way in javascript to force new contents on every page refresh. Anyone know a way to do it like that?
  4. I've got what at first would seem to be a simple issue to resolve.  I have a js timer that changes content visibility every couple of seconds, all within the same area in a page.  To change the visibility, the javascript simply sets style:visible to one area of content, and sets the rest to hidden.  To accomplish that, I had to have several div tags.  The javascript then sets each div tag to visible or hidden accordingly.  What I want to have happen next is this - when user moves the mouse over that area, the js timer stops, and the current content remains visible, until the click one of a few tabs I have in the top portion of the area, or until they mouseout.  When the user mouses out, the timer should kick in again. So I have the following code: [code]<div id="MyMainAreaDiv" onmouseover="javascript:StopTheTimer()" onmouseout="javascript:StartTheTimer()"> <div id="content1" style=(visible or hidden depending on js timer)</div> <div id="content2" style=(visible or hidden depending on js timer)</div> <div id="content3" style=(visible or hidden depending on js timer)</div> </div> <!-- this div closes "MyMainAreaDiv" -->[/code] This works fine, except for one thing - when the mouse is inside the area, every time it moves one pixel, it thinks it is mousing out of 'MyMainAreaDiv' and mousing back over, again and again, because content1 content2 and content3 all take up exactly the same area within the page.  So when you mouse over the area, it does stop if you stop moving the mouse.  But move the mouse around some within the area, and the content visibility changes very rapidly.  Hopefully I explained it well and left enough code.  Any suggestions appreciated.  I am thinking I may need to write some event listener...  I tried a delay on my javascript StartTheTimer, like a pause of a couple seconds, but that caused all kinds of odd behaviour with the actual js timer functionality ...
  5. what are your post variables supposed to do?
  6. I have audio files stored in blob type in mysql db. Webpage has list of these files which are links: [code]while(list($id, $name)= mysql_fetch_array($result)) { echo ("<li><a href=\"download.php?id=".$id."\" onclick=\"showCont(this); return false;\""); echo (" title=\"".$name."\">".$name.""); echo ("</a></li><br />");[/code] I want user to click a link and the file plays in embedded audio player. how to make it happen? I have [code]<embed id="desc" src="/" autostart="true" volume="100" loop="false" height="200" width="300" controls="console">[/code] and javascript showCont() sets the src attribute depending what the user clicks. How can I grab that $id, retrieve the blob file from the db and have it play?  I'm thinking it should be uploaded to a temp directory on my hosting server then played back for the user...
  7. Any reason why a session id cannot be passed in a form's hidden field?  I'm trying to do so but session values are being lost!
  8. Does your web host offer any kind of support?
  9. Question: can javascript pass variables to php?  I don't know of a way, other than through some other medium such as changing the value of an html element or after submitting a form.  Any other ideas about that?
  10. Thanks a lot doni!  I like your abs switch and will try out the way you've built the table.
  11. nvm I found some info on it.  Called a ternary operator if anyone is interested ... Thanks again Dre
  12. Thanks, that seems to do the trick. Where can I learn more about what you did in your line [code]  $switch=($switch != 0 ? 0 : 1);//If $switch != 0,$switch=0, else $switch=1[/code] That's really powerful! Thanks DrDre.
  13. The array comes out of a database.  What I've done is counted the number of results returned.  What I want to do is run a foreach to create a table that prints out the contents of each record into a row.  however, the trick is that I want to have 2 columns.  So the 1st column, on the left, shows half the records, and the 2nd column shows the other half.  If the results are odd, then the first column should be just 1 longer than the 2nd.  Any suggestions on how to specify how the table gets printed out in a foreach?
  14. I have an array like this: [code]Array (     [0] => Array         (             [name] => Caroline             [description] => Description of Caroline             [url] => http://ww.caroline.com             [name] => Caroline.jpg             [path] => /path/to/         )     [1] => Array         (             [name] => Eric             [description] => description of Eric             [url] => http://ww.eric.com             [name] => Eric.gif             [path] => /path/to/         )     [2] => Array         (             [name] => Tony             [description] => This is a description             [url] => http://ww.Tony.com             [name] => Tony.jpg             [path] => /path/to/         )     [3] => Array         (             [name] => Jodi             [description] => description of Jodi             [url] => http://ww.jodi.com/             [name] => Jodi.jpg             [path] => /path/to/         ) )[/code] How can I get extract those 0, 1, 2, and 3 values?  I want to ultimately use these for placement of each Array item into a 2-column table.  Thanks!
  15. Many thanks for responding.  :)
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.