Help setting up Window.location.href to open a file, and 1 other issue

Hey there,
I am a student currently working on a school project where I must make a website. I am trying to set up: window.location.href="C:\Users\*PCNAME*\Desktop\*SITE*"; in that fashion to open up a local file on my HDD, so when I click a specific area, it opens that page from my local files. This setting works with opening web pages like "http://www.google.com" just fine, but when I attempt to instead open up a file location I am given an error.
Also, my other question is how to have more than 1: <script type="text/javascript"> function LinkTo(){, so that I can have 2 seperate buttons on my web page linking to 2 seperate sites.
Here is a link to the PasteBin with my code: http://pastebin.com/Eawy2hcL
Basically, I am wondering how to set up window.location.href to open  up a page located in my files rather than from the internet like Google or Facebook; and, I am wondering  how to have multiple LinkTo scripts set up so different buttons link to different pages and how to link those buttons to each script. I am new to Dreamweaver, so forgive me if anything is blindingly obvious! 

Okay, I'll try to explain better. Btw, thanks for the bottom part. Figured out I am not supposed to put the full location of the file, only the page (index.html), not C:\Users\*NAME*\etc...
Anyways, I am wanting multiple scripts.
Basically, I want the left cell to, when clicked, go to NewCars.html, and the right cell to link to UsedCars.html. It is a table that I have configured to be clicked anywhere in the cell rather than just having to click the words to go to a link. The code is:
<table width="100%" border="1">
  <tr>
    <td style="cursor:pointer;cursor:hand;" onClick="LinkTo()" width="50%" bgcolor="#C5B8B8"><h2 style="text-align: center">Shop New</h2></td>
    <td style="cursor:pointer;cursor:hand;" onClick="LinkTo()" width="50%" bgcolor="#C5B8B8"><h2 style="text-align: center">Shop Used</h2></td>
  </tr>=-
</table>
I have the LinkTo script set up, but I don't know how to add another LinkTo script that goes to a different page so that way the first LinkTo script for the"Shop New" cell takes you to the NewCars page, while the "Shop Used" cell takes you to the ShopUsed page.

Similar Messages

  • Trying to open a page in IE-tab using javascript, script type="text/javascript" window.location.href="chrome://coralietab/content/container.html?url=0,myurl" /script Error:Component returned failure code:0x80004005 (NS_ERROR_FAILURE) [nsIDOMLocation.href]

    I am trying to open a page in IE-tab using javascript like this, <script type="text/javascript"> window.location.href = "chrome://coralietab/content/container.html?url=0,myurl" ;</script>.Error occured : [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMLocation.href]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame ::myurl :: load :: line 234" data: no] I have IE-Tab plug-in installed..when I open the same link manually in mozilla,it works fine and page gets opened in Ie-tab.

    The only way this might be possible is by using the HostContainer object
    to access the HTML page and do it from there.

  • Javascript with window.location.href no longer working in Content Editor in Sharepoint 2010 where users have IE8

    I have recently found that when using a Sharepoint 2010 Content Editor web part to house some Javascript that the window.location.href (or window.location) is not working when the end users have IE8 installed on their PC's.  We have confirmed
    that the window.location.href is working if the users are on IE7 or Google Chrome with the same Javascript.  In addition, we added alert() to the javascript to ensure that it was infact running, which the alerts appeared on the screen with no issues. 
    The result that I am receiving in IE8 is that when the window.location.href is set to the url that the user should be directed to, it simply refreshes the current page and leaves the user where they originally were.
    I have seen the posts to have my site setup as a Trusted Site, but this is not an option for our company as they defined all internal Sharepoint sites as trusted already.  Besides this, having all users go into their Internet Options is not really a
    solution but a means to annoy your users.
    What I am looking for is a permanent solution that I can make within my javascript that will work for both IE7 and IE8 users within a Sharepoint 2010 environment.  If anyone has any suggestions, please let me know.  Thanks in advance.
    Below is a snipet from my javascript code for review:
    <script type="text/javascript">
    function RedirectUrl() {
    alert('button pressed');
    var tb = document.getElementById("tbSearch").value;
    var cs = document.getElementById("sfield").value;
    var url = "";
    if (tb != "") {
    url = "FilterName=" + cs + "&FilterMultiValue=*" + tb + "*";
    if (cs == "Request%5Fx0020%5FID1"){
    alert("Request%20ID%20Search.aspx?" + url)
    window.location.href = "Request%20ID%20Search.aspx?" + url;
    else {
    window.location.href = "All%20Requests.aspx?" + url;
    else {
    return false;
    function ClearUrl() {
    window.location.href = "All%20Requests.aspx";
    </script>
    <br/>
    <span style="font-family: calibri; color: #000066; font-size: 14pt; font-weight: bold">Search</span>
    <br/>
    <span style="font-family: calibri; color: black">Search Field: </span>
    <select id="sfield" style="font-family: calibri; font-size: 10pt">
    <option value="Request%5Fx0020%5FID1">Request ID</option>
    </select> &#160;
    <span style="font-family: calibri; color: black">Search Text: </span>
    <input id="tbSearch" onkeypress="if (event.keyCode == 13) document.getElementById(&#39;btnSearch&#39;).click()" style="font-family: calibri"/>
    <button id="btnSearch" onclick="return RedirectUrl();" type="submit" style="font-family: calibri">Search</button>
    <button id="btnClear" onclick="return ClearUrl();" type="submit" style="font-family: calibri">Clear Search</button>
    <br/>
    <br/>
    <span style="font-family: calibri; color: #000066; font-size: 14pt; font-weight: bold">Search Results - All Requests</span>
    <br/>

    Hi,
    According to your post, my understanding is that the window.location.href not worked in IE 8.
    I think the issue
    is likely due to the value of your variables. If they contain special or invalid characters, those needs to be passed through
    encodeURIComponent before being assigned to window.location.href.
    http://stackoverflow.com/questions/18278777/window-location-href-not-working-on-ie
    http://stackoverflow.com/questions/6297291/window-location-problem-in-ie
    You can also use the following methods to check whether it works.
    Window.navigate();
    Winodw.history.back();
    Self.location.href;
    Top.location;
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • Javascript's window.location.href stopped working on FF 17.0.1

    I used window.location.href to navigate pages in my application. Suddenly it's not working anymore with upgrade to v 17.0.1
    Still works in v16... but most of the company users upgraded to v17, and now it's a big proglem
    WHAT TO DO?

    The piece of code that I have is something like
    "<a id="action_url" href="/abc/xyz" name="action_url">Data</a>"
    abc/xyz is a struts action

  • In Mountain Lion, how do I find the location of an open Preview File?  The file "properties" tab is no longer available.

    I typically have several open Preview files at any one time and often forget where, sometimes if, I saved them.  In Mountain Lion, how do I find the location of an open Preview File?  Tried holding option + command in spotlight but I don't see a path name appear anywhere. 

    Yes, cmd-option on a file you choose in Spotlight and the path will appear at the bottom of the Preview window.
    EDIT: Also, if it is bookmarked the path is in Bookmarks.

  • How open a file and not showing window?

    I write a script to do some work automatic,
    for Indesign script, its application open method could open a file and not showing window,
    the open method has a parameter [ShowingWindow] (if true, show the document window).
    That is good a feature for me.
    But with Illustrator, the application open method hasn't the same feature.
    Open
    (files as String,
    [documentColorSpace as AiDocumentColorSpace],
    [options as Object])
    and for OpenOptions properties, there is not useful information for me.
    Is there any other methods could do that?
    Any help is greatly appreciated.

    Thank for your reply.

  • Help - "Acrobat is being used by another application and cannot open PDF files until the other application is closed."

    Hello,
    I searched this site and google for this error terminology and come up dry.  I support a user who has been for years using Acrobat 5 (yes, I know...) to read files in a client DB program, as well as other PDF files on their PC.  In the last week or so, they have started gatting this error "Acrobat is being used by another application and cannot open PDF files until the other application is closed." any time they attempt to open a PDF file attached to an email (via Outlook).
    It is my understanding that they cannot upgrade to a newer version of Acrobat because of limitations of their client software, but had not previously had any issues viewing PDF notes from the DB, and PDF attachments in their email.
    I have tried uninstalling and re-installing, as well as tried using Adobe Reader 7 & 9 in conjunction with Acrobat to try to get around this issue, but have not been successful.
    Any ideas?
    Thanks,
    Jesse

    I don't have an answer to your technical problem. The product I assume is Acrobat that you are talking about (based on the post title), Adobe is the company name. This is a good place to ask questions on Acrobat if folks can figure out what you are talking about. They will ask for the product version number (like AA9.3.3), operating system, and other applications if appropriate. Also, just what you are doing that generates the message.
    As for Adobe, you are not likely to get an answer from them here in the user forum. You will be lucky if you can get an answer if you can contact them and not be on hold for more than an hour (sorry, this is why a lot of folks end up in the forum).
    So, to help others try to answer your question, what are the products and versions involved? What OS? What are you doing when the message comes up.

  • Someone help! i went to open a file and the "initializing" box froze

    ok. heres my deal. i recorded something w/ a friend one day and we opened the file and did whatever with it and it was fine. we would even come back later and open the file again and it still worked great. the next day however, i went to open the same file to record/edit more with it and it simply would not open. no error message or anything. the "initializing" box just sat there forever. is it corrupted? and if so how can i fix it?? pleeease help!

    <sigh> Wish I could tell you the "why", not being there myself it's impossible, and even if I were, it's hard to say if even then I'd know.
    The bigger "sigh" is that the last resort was to try opening the package and dropping the raw files into a new project, but if they're not there at all, then there really isn't anything to do, the files are gone B-(>
    The only advice I can offer at this point is some for the future: If you have a one of a kind take, never work with the original, and at that always make a copy and put it somewhere else (another computer, another hard drive, and/or a CD/DVD.
    Sorry I don't have better news, Kurtis --Hang %-(>

  • I cant set my ps cc 2014 as a default program to open psd files and alike. What will I do?

    I cant set my ps cc 2014 as a default program to open psd files and alike. What will I do?

    What will I do?
    You could try giving pertinent information. (edited)
    http://forums.adobe.com/docs/DOC-2325

  • Open picture files and display in fullscreen slideshow?

    I'm hoping for some help as I'm very new to LabView and quite lost....
    I have a directory with many picture files (too many to put them all in
    a powerpoint slideshow) and i want to open them one by one and display
    them full screen with no border around them (not in a picture box, but
    as displayed in a powerpoint slideshow). 
    I'm trying to use activeX to call the default "Preview" application for
    windows, (which is able to run a slideshow when opened manually from
    the directory).  In the LabView VI, when the slideshow runs, it
    takes over the full screen, as it should, however, the images are not
    shown.  The screen says "no preview available".  I've messed
    around with it a lot and just can't get it to work. 
    Any other application or any other way of displaying the images full
    screen would be acceptable, if you know of any.  I've also tried
    the adobe acrobat browser 7.0, which has a full screen option, but i
    can't seem to get that one to work either.  Attached is a copy of
    my code.
    Any help or advice would be much appreciated.  Thanx.
    -dave
    Attachments:
    picture viewer2.vi ‏75 KB

    The easiest would be to set the window not to have toolbars, scrollbars, etc. and to fill the entire screen and to scale all objects with the windows (these can be found in 2 pages of the File>>VI Properties dialog). If you resize your FP so your picture indicators fills it before doing this then any resizing of the window will resize the indicator as well. You can then use the Zoom property to enlarge the picture. To calculate how much to zoom you can divide the size of the picture by the Application>>Display>>Primary Workspace property.
    Another option would be to use property nodes to change the Draw Area Size of the picture to fill the screen and to resize the picture itself using something similar to the method demonstrated here.
    Try to take over the world!

  • System exec, How I say to open one file and make operation in external program?

    Hi,
    I got called an external program with the system exec.vi, but i would like the program open the file saved in the other window, i can get the file path, but how Can I put the file path in the external program and the program open the file and I tell (in this case compile), since i open one file code c and only i must to open and say to the program 'compile' and then close external program.
    Any help?. Thanks.
    Attachments:
    system_exec.GIF ‏8 KB

    Hi Fonsi,
    System Exec.vi will allow you to run commands like launching a program easily but it is difficult and many times not possible to execute commands within an application.
    A better way maybe to approach this though ActiveX. Please look at the following example that uses ActiveX to communicate with Excel.
    Writing Rows to Excel 97 and Excel 2000 Using ActiveX
    If you are not familiar to ActiveX and LabVIEW, please read the document below:
    ActiveX and LabVIEW
    I hope this
    helps.
    Sincerely,
    Feroz
    National Instruments

  • I want to open a file and have it fill the desktop - how??

    I have recently moved over from CS2 on PC to CS3 in MAC - I used to be able to open a file and it would open up in a full window filling the whole screen - now it opens up in a box with no surrounding space. When I maximize the minute I tap cmd + the widow reduces to minimize and just zooms into a part of the file. I am sure this is basic stuff but any help out there please??
    gratefully
    Angus

    That's the difference between Macs and Windows. Windows opens applications in a... Window.
    Try hitting the F key and see if that works for you.

  • Photoshop shut down while I drew a picture, now the file is broken and I can´t fix it, photshop won´t open the file and I have tried repearing it with different programs. What should I do?

    Photoshop shut down while I drew a picture, now the file is broken and I can´t fix it, photshop won´t open the file and I have tried repearing it with different programs. What should I do? I spent 6 hours on the pic and I dont even have a screenshot or anything.

    You don't even say what platform you are on, or any other details that may help others assist you.
    If you are on a Mac, try opening your file in GraphicConverter (they have a demo version) if that doesn't open it, nothing will, in my experience.
    I assume you have tried Adobe Illustrator already to recover.
    You may also have a JPEG of your complete file (flattened) in Bridge Cache.
    On the Mac you'd find it in your User ~Library (NOT the Root Library ):
    Users > yourname > Library > Caches > Adobe > Bridge CS6 > Cache > 1024 > jpg(fileID)number Filename.psd.jpg
    The user ~Library is hidden, but you can make it visible for an moment or two.  Ask Apple if you don't know how.
    I don't do Windows.

  • Whenever I open a file in Lion, other files of the same sort that I opened previously automatically open up. For example, if I open a .jpg file, numerous other .jpg files that I opened previously in the day open up. How do I prevent this from happening?

    Whenever I open a file in Lion, other files of the same sort that I opened previously automatically open up. For example, if I open a .jpg file, numerous other .jpg files that I opened previously in the day open up. How do I close these files to prevent them from showing up again, like in previous versions?

    Dealing With The Resume Feature of Lion
    Managing Mac OS X Lion's application resume feature.
    If you shutdown your computer you should get a dialog asking if you want applications to resume on the next startup. Simply uncheck the box to prevent that from occurring. Open General preferences and uncheck the option to Restore windows when quitting and re-opening apps. You can also install a third-party utility to control resume features on individual applications: RestoreMeNot or Application State Cleaner.
    It is possible to completely stop the Resume feature although I'm unconvinced that it is that annoying. Nevertheless see the following:
    If you have not yet done so you must first make your /Home/Library/ folder visible. Open the Terminal application in the Utilities folder. At the prompt paste the following command line:
    chflags nohidden ~/Library
    Press RETURN. Quit the Terminal application.
    In the Finder navigate to the /Home/Library/Saved Application State/ folder. Delete the contents of the folder. Back up to the /Home/Library/ folder. Select the Saved Application State folder. Press COMMAND-I to open the Get Info window. In the Sharing and Permissions panel at the bottom click on the lock icon and authenticate. Set each of the listed entries to Read Only. Close the Get Info window.
    Quit all open programs except the Finder (this is very important.) Next, navigate to the /Home/Library/Preferences/ByHost/ folder. Look for a .plist file with "com.apple.loginwindow." in the file name followed by some numbers in hexadecimal. Select the file. Press COMMAND-I to open the Get Info window and in the Sharing and Permissions panel click on the lock icon and authenticate. Set each of the listed entries to Read Only. Close the Get Info window. If you also find a file with the same filename but with a last extension of ".lockfile," then you should delete it.
    The above should eliminate the Resume feature system-wide. Note that any future system updates or upgrades will likely undo these changes. You will then need to repeat this procedure assuming there are no major changes in OS X related to it.

  • Having problem opening my files and pictures with word 2013

    I  can not open my files and pictuers with office word 2013 ,everything goes to adobe and it would not allowed me to convert it to  office word 2013
    You can reach on  [email protected] or [email protected]
    thanks

    Gizmo,
    Select one of these files in the Finder, then press Apple-I to open a Getinfo window for it. Use the "Open With..." pull-down menu to choose Preview as the default application, then click the "Apply to All" button.
    If Preview is already set as the default application, try choosing another one, clicking the "Apply to All" button, then re-do the whole thing using Preview.
    Scott

Maybe you are looking for

  • The Adobe Flash plugin keeps crashing on Firefox 12.0

    The Adobe Flash plugin keeps crashing on Firefox 12.0, and my Plugin Check link in Addons Manager directs to https://www.mozilla.com/en/404 . Is this a hack attempt? Is Firefox 3.6 safer than the release channel?

  • Cisco ASA 5505 and comodo SSL certificate

    Hey All, I am having an issue with setting up the SSL certificate piece of the Cisco AnyConnect VPN. I purchased the certificate and installed it via the ASDM under Configuration > Remote Access VPN > Certificate Management > Identity Certificates. I

  • Connecting Yoga 10 to WIN XP by USB

    Hi, 1. Where can I find the USB driver for Yoga 10 tablet, to connect to WIN XP. I have WIN XP with Service Pack 3.

  • Changing the account number through DTW.

    Hello All, wheather Its possible to replace the existing G/L account through DTW. For example, Inventory account is '1021000'(Raw materials) in Inventory data tab in Item Master data. But I want to replace it to '1021201'(Industrial Stock account). P

  • Using loop in workflows

    Hi All,          Can any one help me how to use loop in workflow. Initially i will send workitem to agents. if the loop condition fails i need to send the workitem again to the agents. Thank you, Harsha