Detect Current URL Of PDF File In Different Frame Not Working In IE?
Jun 3, 2010
The system uses individual PDF files for each page, and you can navigate using the controls on the side. It's not ideal, as it was made to replace a horrible system and has the limitations of the content being presented.
That being said, I think it's pretty good. The trouble area is related to navigation: when you navigate the documents, some JavaScript detects the current URL of the content frame and updates the nav controls (previous and next page numbers) and table of contents links (bold, highlight) if they have changed. That part works fine. The problem area is with IE and PDF links. If you click a page link within the PDF, it opens that PDF file in the same frame. In FF and every other browser, the JS URL detection works fine.
In IE, of course, it doesn't detect that a different PDF is being displayed. If it can't detect the new PDF file, and by extension, the file number, the nav controls don't work right. Now - before anyone asks - it DOES work in IE if you navigate to the PDF document by using the links in the navigation system that I built. It's just when you arrive at a PDF from another PDF that it fails.
This is hard to explain more clearly, so take a look: [URL]
To see this in action, visit page 4, the table of contents. Click a page number link, for instance, page 9. Once it loads, click "next page" at the top left of the interface. In FF, it goes to page 10. In IE, it goes to page 5, since the JavaScript is unaware that the frame has changed PDF files. It doesn't make sense, since FF can see it plainly.
My code is all out in the open. This thing has to be designed to run off of a CD as well as on the website. If I could use server-side scripting, it would be VERY different, I assure you.
View 8 Replies
ADVERTISEMENT
Jul 23, 2005
I have two frames. "Top" contains a local file on my server with the aforementioned javascript. "Bottom" is a remote website on a server I do not control. I want to use javascript in "Top" to determine what the current url is in the "bottom" frame...
View 1 Replies
View Related
Jan 5, 2011
I have a button (in html) and I want the center of the button to be on the center of the line I'm typing on... I was just putting it inside a span and then using this code to move it down.
<span style="position:relative; bottom:-10;">
It worked great! But... once I started allowing my users to change the font sizes the buttons got bigger and they needed to be moved down further...
if the font size was +1:
<font size="+1"><span style="position:relative; bottom:-10;">
if the font size was +6:
<font size="+6"><span style="position:relative; bottom:-27.5;">
So is there a way in javascript to detect the current font size and then adjust the span position based off of that? If I can just get the number of the current font size I can do all the rest of the coding, I just need a way to figure out the current font size and put it in a variable... I was thinking of using something like 1.0em so that it stays the same but then we have a basis of measuring off of but I have no clue..
View 1 Replies
View Related
Dec 21, 2010
If a form as an input='file' element, and someone clicks on BROWSE and then changes their mind and clicks CANCEL, if JavaScript can detect that cancel?
View 2 Replies
View Related
Jul 23, 2005
I have a webpage in which a media player is embedded.I would like
to close the page at the end of the video. Can I detect the end of the
file so as to close the page programmatically?
View 1 Replies
View Related
Mar 22, 2006
I need to detect the size of a file entered via input type file. How do I do this? Also it should work on both IE and FireFox.
View 2 Replies
View Related
Aug 2, 2011
I want to make it so that when a file is being dragged I activate a filedrop, that would otherwise be inactive. Yet I do not know how to detect when a file is being dragged (much like how gmail changes when you are dragging a file). Can anyone point me in the right direction as to how this can be accomplished?
View 2 Replies
View Related
Feb 2, 2006
I have a simple page with two frames, left which houses a menu and a right frame which is used for the site content.
On the left hand menu frame I have a simple login system which requires the user to login, when they login a cookie is created called memberCookie to hold their memberid.
When they are logged in one of the options is to logout, on this page is a link to an external JS file called alert.js, which simply prompts the user if they wish to logout in a function called alert_logout Code:
View 5 Replies
View Related
Jul 23, 2005
Is it possible to use javascript to get a list of files from the current
directory where the html page that contains the javascript is being called?
The reason is that I want to find all ".jpg" files in the current dir and
randomly display one. Right now I am manually putting each file name in an
array element, very hard to maintain.
View 5 Replies
View Related
Jun 17, 2009
How to detect if the file has downloaded completely?
View 6 Replies
View Related
Feb 3, 2010
I have a frameset with 2 frames. From one frame I am changing the URL of the second frame and I want to know when the second frame has loaded. I have tried the following but it doesn't work.
parent["targetFrame"].onload = function()
{
alert('frame loaded');
}
parent["targetFrame"].location = "http://www.google.com";
The content of the targetFrame changes but the function never gets executed. I have tried various variations such as parent["targetFrame"].document.onload
View 2 Replies
View Related
Mar 29, 2009
A pgn-file is a plain text file. It's used for chessgames.I want Firefox 1.5.0.12 on Win XP SP2 to show the pgn-file in a frame when I click on the link.That's the first problem: Since I installed some years ago some chessprogram Firefox always asks what to do with a .pgn-file (Download dialog).I know I can change this behaviour either in config:about or in some configuration file for mime types.But how to do that??? (There are extensions for that, but only for Firefox 2 and higher. ): And I would prefer to change it via the about:config-file or in the mime-configuration file, some .rdf-file I think.Then I want to access the plain text in that frame with javascript. How could I do that?(If you need a pgn-file to test, just take any text-file and rename the ending to .pgn.)
View 8 Replies
View Related
Dec 9, 2005
I need a JavaScript code to load pages into another frame. The thing is, I want to control the pages that are loaded using an external javascript (.js) file.
View 7 Replies
View Related
Nov 2, 2010
Got an assignment for a javascript class and I have been banging my head against the wall for a week now.[code]In the main page I have tried several different ways to access the "src" property of the image, none of which I am 100% sure is correct. I think the problem is in the main page, in that I am not accessing the image right, but I could be wrong. I have spent hours on google and digging through the book, but I am still coming up empty handed.
View 1 Replies
View Related
Jul 23, 2005
I have a window open, let's say index.html. On the page I have a link that executes a javascript. I want the javascript to open file new.html in the same window that index.html was displayed in. How do I do this? Everything I try opens a new window.
View 2 Replies
View Related
Jul 23, 2009
I'm developing a framework that allow all navigation in normal mode or in ajax load.
I have a form to upload images and I can upload files correctly, but if I use the ajax form, the save page don't receive the HTTP_X_REQUESTED_WITH in $_SERVER PHP array (only occours when a file is uploaded).
How can I detect an ajax load with a file upload form?
View 3 Replies
View Related
Aug 6, 2007
I am new to this forum, so your help would be most appreciated.
I am trying to create a javascript where, on clicking a button, I will
be able to download the latest log file. But the log filename changes
everyday as it takes the current date as part of the filename. eg.
EMEA_20070806 i.e. EMEA_yyyymmdd
Also, the previous day's log file is stored in the same directory.
How can I create a button where it will download the latest log file
at all times?
View 2 Replies
View Related
Jul 23, 2005
I have a script that allows me to highlight a row of text.
This text is in a table.
The table is long and scrolls down the page below the visiable canvas.
What I need is a method to jump to the highlighted row.
I am able to jump to my anchor as long as the anchor isn't located
within the table (ie I can jump to the bottom of the table if I put the
anchor just below the table). However as soon as I place it within the
table...no luck.
Here is the code I am using to jump;
eval ("document.location='#row" + n + "'");
Can someone explain how I can reference the table in my jump method?
View 3 Replies
View Related
Apr 12, 2010
I am trying to build a function that displays the current day for example today is monday so I simply want it to say monday. however I have noticed javascript displays the current day of the week in numbers so:
monday = 1
tuesday = 2
wednesday = 3
and so on, however I cannot see why this function is not working to display the full names:
Code:
function datecount(){
var date = current.getDay();
var day = "Current Date Is Undefined"
if (date = 1)
{
var day = "monday"
}
[Code]...
View 5 Replies
View Related
Apr 28, 2010
I've built in an iFrame that pulls in various other pages of variable height. Can you make this iFrame render its size based on it's src content ? I've been trying to use the scrollHeight of the frame but it isn't working. My current code:
Code:
<script type="text/javascript">
function resizeIframe (frame) {[code]....
Basically my code always renders the scrollHeight at 150 but the test.html I'm pulling into the frame I've made a height of 500px ?
View 1 Replies
View Related
Oct 26, 2009
I'm new to js/jquery and this forum so please forgive my potentially off-scope js/jquery remarks. I've been running a lot of toggles to show, hide, etc... divs and other HTML elements. It's making my application incredibly nice navigation wise.
Now to put myself in my users shoes. Say one user toggles on and off the things they want and don't want until they are satisfied with all the content of the screen. (That is by the way the nature of my application. A user loads in various variables via PHP and other means and when satisfied, a PDF is generated for them containing all their preferred content.)
Because: When a user is at a point where all the content they are viewing is worthy of a PDF, it is also worth saving that HTML 'view' (classes switched, variable adjusted, etc...). I would call it 'Save this workspace' or something along those lines.
I don't have a direct question per se but am more interested in the views of others who have similar thoughts and moreover, what relationship has jQuery had in helping employing some method?
View 4 Replies
View Related
Apr 9, 2011
I new this is not to hard but I forgot on how to do it.I have this form:
<form><table><tr>
<td>Add Picture:</td>
<td colspan="3"><input name="txtPics" type="file" /></td>
[code]....
View 1 Replies
View Related
Jul 28, 2011
I have found a script for opening all linked images of one page in a new window and displaying all images in full size inline. It works so far, however:
I want the images to be displays in the current window i am in instead of opening a new window.
Here is the code:
Code:
javascript:(function(){function%20I(u){var%20t=u.split('.'),e=t[t.length-1].toLowerCase();return%20{gif:1,jpg:1,jpeg:1,png:1,mng:1}[e]}function%20hE(s){return%20s.replace(/&/g,'&').replace(/>/g,'>').replace(/</g,'<').replace(/"
[Code]....
View 3 Replies
View Related
Mar 5, 2009
To sum up this issue, I have a parent page, which holds some values in hidden input fields passed to them from the url. On this page, I have an iframe with a form in it, to which I want to pass values from these hidden fields to be displayed for the user in the iframe form. In IE, it works. To accomplish this, im just simply doing a <body onload="GetInput()">. The GetInput function does the following, but for about 10 fields:
Fnamefield=document.getElementById('firstname').value = parent.document.getElementById('firstname').value; Thats it. Once the page loads, i see my values. In firefox it does not work. I know the hidden fields are getting their values, but thats as far as it makes it. I have tried calling the GetInput function after the form is written out and not in the body tag, which still works for IE, but not FF.
View 3 Replies
View Related
Apr 27, 2009
When the JS file is not working at the time of Ajax files is called. on first time the onmouseover JS is working but , if you call the ajax JS is not working.
View 2 Replies
View Related
Aug 26, 2011
I have a domain: example.com; which is the parent.And a subdomain: api.example.com; which page 'receiver.html' is being loaded in an iframe, child of parent. Both pages set document.domain = example.com.
I'm trying to adapt this code:[url] but Idon't want to load jQuery from the <iframe> again but I need to have the method $.ajax() working from the <iframe> otherwise it would be a cross-domain request and the browser would abort it. I tried ingenuously to set via $('iframe')[0].contentWindow.$.ajax = $.ajax() and I just got a shortcut to the parent page jQuery method. I also tried to "clone" it using $.expand (true...) but the method doesn't work for me; probably because of the complexity of the objected I'm trying to clone. So is there a way for me to use jQuery to have only a $.ajax() method in the <iframe> ? I've thought even about creating a XHR in the child-iframe and then use that in the $.ajaxSetup ({xhr: THATNEWXHR}) but I couldn't do it. I mean, I want to use the XHR factory from jQuery (which has fallbacks for IE, etc) but it has to be created from the iframe-child.
Maybe there is other way to make the AJAX call come from the child-iframe.
If you're wondering "why don't you load jQuery from <script> in the child-iframe", there is a reason... As I'm using jQuery plugins + my own custom javascripts + other independent scripts I created a compiler which minifies each file and bundle them in one. The advantage of this is the reduction of HTTP requests. So "why don't you load that bundle inside the child-iframe?", because it's ugly and Twitter doesn't... Yeah, I like to take Twitter as a reference and I think if they were able to make it so can I;
I got to work in most browsers except IE and Operaby doing it with pure javascript.
I'm "attaching" the code for you guys to test. If you open it with Chrome, Safari or Firefox you will receive 2 alerts one with the return of $.get() and another with the return of a request made via XMLHttpsRequest object. Otherwise (if you open it with IE or Opera) you'll get 'undefined' in the first alert but the real return in the second.
This is the example.com/index.htm:
View 4 Replies
View Related