Uploaded html code is reformatted disabling javascript functionality

I've asked this before but not had a comprehensive resolution.
This issue began when I moved from my apple powerpc running OSX 10.5.8 to an imac running 10.7.3 and for the reasons you'll see I'm sure this is connected with mac OS than dreamweaver, but I would appreciate any feedback from anyone else who has experienced this problem.
The Problem:
The code in html files uploaded using dreamweaver or filezilla get reformatted into one continuous line. In itself this is not a problem until javascript is included. Javascript won't function without linebreaks and so menus and galleries all stop functioning. If I download the file I can reformat the page but that doesn't stop the problem. The source code as viewed in the browser is one continuous line and that's what the browser seems to be reading.
Work around
My work around so far has involved connecting my drive up to my old machine and uploading  javascripts from there (using filezilla, dreamweaver4 for powerpc or even dreamweaver 8). Trouble is, my powerpc power unit has now died and I don't have that option, and occasionally I actually would like to see the javascript or spry references in the document and not buried in server side includes.
So all this would suggest that it's not a dreamweaver issue. All the files are created using dreamweaver 5.5 and upload perfectly well using older versions or filezilla as long as I use an older apple OSX. It seems to center on the OS.
Has anybody else had this?
Simon

I don't think the code rewriting settings would be a factor in your particular issue (though I'll never say never) but line break type could well be an cause. Depending on the web server, it may well treat some LF endings incorrectly. If your web server technical staff can't help, you might try experimenting with the other setttings and see if one of the other settings works correctly. UNIX-style endings are the most common, but your server might want something different.
Regards.

Similar Messages

  • Uploaded html code is reformatted

    I've asked this before but not had a comprehensive resolution.
    This issue began when I moved from my apple powerpc running OSX 10.5.8 to an imac running 10.7.3 and for the reasons you'll see I'm sure this is connected with mac OS than dreamweaver, but I would appreciate any feedback from anyone else who has experienced this problem.
    The Problem:
    The code in html files uploaded using dreamweaver or filezilla get reformatted into one continuous line. In itself this is not a problem until javascript is included. Javascript won't function without linebreaks and so menus and galleries all stop functioning. If I download the file I can reformat the page but that doesn't stop the problem. The source code as viewed in the browser is one continuous line and that's what the browser seems to be reading.
    Work around
    My work around so far has involved connecting my drive up to my old machine and uploading  javascripts from there (using dreamweaver4 for powerpc). Trouble is, my powerpc power unit has now died and I don't have that option, and occasionally I actually would like to see the javascript or spry references in the document and not buried in server side includes. I'm now using my laptop running dreamweaver 8 just to upload files
    So all this would suggest that it's not a dreamweaver issue. All the files are created using dreamweaver 5.5 and upload perfectly well using older versions or filezilla as long as I use an older apple OSX.
    Has anybody alse had this?
    Billy the kid

    Essentially when you're uploading your files, dreamweaver has removed all the carriage returns.
    I believe a preference in Dreamweaver.
    It's called All in line Code.
    It's commonly used by companies that want to make their html code difficult to read.
    Have a look at google.com's source code and you'll see that it's nasty difficult to read.
    I'm not sure where the preference is in Dreamweaver, but I read somewhere a long time ago that it was a feature that you could enable for your website.
    You should be able to disable it for any of your java scripts, and enable it for your HTML pages.
    Or disable it all together.
    Call Adobe and get them to help you find it.  If it's a legit copy of Dreamweaver, I'm sure they'll be more than happy to help out!  The worst wait time I've had with them is like 15 minutes.  Not bad...
    HTH
    -Graham

  • I want to upload HTML code from an existing site and then revise in Muse. Is this possible?

    I want to upload HTML code from an existing site and then revise in Muse. Is this possible?

    HTML files from an existing site cannot be reused in Muse as Muse works only with files having extension as .muse.
    However, you use apps like Dreamweaver to edit your existing HTML files.

  • Calling a javascript function from java code and getting tha value in Java

    Hi,
    I would like to call a Java script function confirmRemove() from Java code upon meeting a condition..
    for example the code snippet is:
    if(true){
    // I want to call js confirmRemove() over here. And get the value of variable "answer" in this if block.
    <html>
    <head>
    <script type="text/javascript">
    function confirmRemove() {
         var answer = confirm("Are you sure you want to Delete?")
    </script>
    </head>
    <body>
    <form>...

    Hi,
    Back in 2003 I have used an Applet which contain java code and this java code was calling the java scripts ( different methods, DHTML etc..)
    There was a component developed by NetScape called JSObject I am not sure it there is other third party component other then the JSObject
    look at this article which shows how (based on JSObject)
    [http://java.sun.com/products/plugin/1.3/docs/jsobject.html|http://java.sun.com/products/plugin/1.3/docs/jsobject.html]
    Regards,
    Alan Meio
    London,UK

  • Embed html code with Oracle Apex report

    hello Everybody,
    Iam wondering if you guys have any idea about embeding my own html code that has a javascript and html stuff in Oracle Apex page.
    Thanks,
    Abdul ALkhateeb

    Abdul,
    This is very common and can be done a few ways. It's actually one of the great things about ApEx - VERY flexible. Please be more specific about what you're trying to do so we could point you in the right direction.
    Regards,
    Dan
    http://danielmcghan.us
    http://sourceforge.net/projects/tapigen

  • Pass a para to javascript function

    In a jsp page, a javascript function needs to get a parameter from a variable of the jsp page. How can I do this? Thanks a lot!
    ---a.jsp---
    <SCRIPT language=JavaScript>
    function changeR(userID){
    alert( userID + " chaged a value " );
    </SCRIPT>
    <% userID = "user1" %>
    <form>
    <input type="button" value="bbbb" onclick="changeR(userID)"> <!--it doesn't work this way-->
    </form>
    How should I write this part?
    onclick="changeR(??????)"

    <%! String userID=""; %>
    <html>
    <head>
    <script type="text/javascript">
    function changeR(userID){
    alert( userID + " chaged a value." );     // this line doesn't work.
    alert( "alert" );          // even this line doesn't work either.
    </script>
    </head>
    <body>
    <% userID = "user1"; %>
    <form>
    <input type="button" value="<%= userID %>" onclick="changeR(<%= userID %>)"> <!--it doesn't work this way-->
    <input type="button" value="userID" onclick="changeR(userID)"> <!--it doesn't work this way-->
    </form>
    </body>
    </html>
    This is the sample jsp page. There are two ways tried (two buttons), none of them works. :(
    When the first button is pushed, there's no response.
    When the second button is pushed, the status bar shows "Script Error!".

  • Trigger Javascript function onClick of HTMLB button

    Hello Everyone,
    Could anyone give me some sample code to trigger a Javascript function onClick of HTMLB button. Basically I have some javascript code and I want it be executed on click of a HTMLB button. I would greatly appreciate your help. Thanks.
    Regards,
    GY

    Hi,
    as Ravi wrote, you trigger javascript functions using the attribute onClientClick. You define first the javascript code in your page and then you can call the code like this:
          <htmlb:button text    = "Some text"
                        encode  = "false"
                        onClientClick = "javascript:Your.Function()" />
    check that you define the code first and then you write the code for your button; otherwise, application will not know that the JS code exists.

  • Javascript function not working in template-based html files

    Does anyone have any insight as to why the following function works only in the .dwt file but not in the related html files?
    *Note: it only works in the dwt file if I change the path of:
    var imgs = new  Array('images/header1.jpg','images/header2.jpg','images/header3.jpg');
    to
    var imgs = new  Array(../'images/header1.jpg',../'images/header2.jpg',../'images/header3.jpg');
    but with the paths reading correctly (as below) in the html files it still doesn't work...
    <script type="text/javascript">
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    function MM_findObj(n, d) { //v4.01
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
    function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
       if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    var imgs = new Array('images/header1.jpg','images/header2.jpg','images/header3.jpg');
    var delay = 7500;
    var counter = 0;
    function preloadImgs(){
      for(var i=0;i<imgs.length;i++){
        MM_preloadImages(imgs[i]);
    function randomImages(){
      if(counter == (imgs.length)){
        counter = 0;
      MM_swapImage('rotator', '', imgs[counter++]);
      setTimeout('randomImages()', delay);
    </script>
    </head>
    <body onLoad="preloadImgs();randomImages()">
    Any help would be appreciated!
    Andy

    Wow - now I have a real doozy for you. That duplicate function has generated itself all on its own. The script in the template file is:
    <script type="text/javascript">
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    function MM_swapImgRestore() { //v3.0
      var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
    function MM_findObj(n, d) { //v4.01
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
    function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
       if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    // Comma separated list of images to rotate
    var imgs = new Array('images/header1.jpg','images/header2.jpg','images/header3.jpg');
    // delay in milliseconds between image swaps 1000 = 1 second
    var delay = 5000;
    var counter = 0;
    function preloadImgs(){
      for(var i=0;i<imgs.length;i++){
        MM_preloadImages(imgs[i]);
    function randomImages(){
      if(counter == (imgs.length)){
        counter = 0;
      MM_swapImage('rotator', '', imgs[counter++]);
      setTimeout('randomImages()', delay);
    </script>
    As you can see - no duplication.
    For some inexplicable reason, this is being added in to all the html pages based on the template:
    MM_swapImage('rotator', '', imgs[counter++]imgs[i]);
    function randomImages(){
      if(counter == (imgs.length)){
        counter = 0;
    Which explains why it works in the template file but not in any the html files. Of course, because the code is not in an editable region, I can't remove it manually from the html files. Have you ever heard of code generating itself in this manner? Or how to solve it?

  • Avoiding html codes and javascript codes in servlets

    Are there ways to avoid long html codes using out.println() and also javascript codes in servlets? Can I make a jsp and include that file somehow in the servlet and do the processing. Can I get reference to the fields or components declared in the jsp and also do conditional flow based on the buttons present in that jsp.
    Is it possible to include javascript files and instead call that javascript file and also the particular function in that file?
    Please also mention disadvantages if any.

    Javascript is for the client ONLY. Even if you could find a way to use it on the server side, DON'T.
    In my opinion, you should have ZERO logic (except for validation via JavaScript) in your JSP. Have a Servlet do all logic/business rules. The Servlet will create one or more Java Beans that hold ALL dynamic content for a page. Use the Servlets RequestDispatcher to forward the request to the JSP upon completion. The JSP should do nothing more than grab these beans (from the HttpSession object) and fill in the dynamic parts of the page.
    By doing it this way, you seperate the logic and presentation. You can add different 'flavors' (WML, XML) by simplying creating a new JSP page that looks for the same Java Beans, but has different template text.

  • IPad = webStageView = HTML = call javascript function thru Flash

    Has anyone loaded a HTML file thru webStageView, and then been able to call javascript functions embeded in the HTML through flash.
    I've seen references to using webStageViewBRIDGE but I think that has been depreciated.
    Below is a link to a Adobe tutorial doing this with the htmlLoader class and FLEX.
    Cross-scripting PDF content in an Adobe AIR application
    http://www.adobe.com/devnet/air/flex/quickstart/articles/scripting_pdf.html
    If anyone has successfully been able to do this on the iPad, could you explain how it's done or provide a link to some documentation.
    Thanks...

    Stagewebviewbridge is a 3rd party library (not an official Adobe product). It looks like it is still supported. The technique described should work even if the library isn't being actively developed.
    http://code.google.com/p/stagewebviewbridge/wiki/Communication
    Also, note that most techniques which use the HTMLLoader class will not work with the StageWebView class -- they are entirely different beasts. (Well, to be precise, on desktop computers, StageWebView uses the same Webkit code, but the interface to it is still very different.)

  • Function to unformat HTML code

    I start to build a report with CF Report Builder (8) and at
    some point, I realize that one of the field I need to display have
    HTML code (e.g.: <p>, <b>, etc...). The fact is that
    this field is using a Rich Editor (FCKEditor) when input the text.
    Until now, I did not have any problem with this but it displays all
    the code in the report (in the CF Report Builder) and it is not
    really human-friendly. I saw that it is a function to transform
    basic text in HTML but is it something to do the inverse?
    Thank's for any help!

    Interesting comment: starting with a drastic "no help for
    you" and finishing with a hope!!! ;-)) I like it!
    Well you actually gave me the idea. I found something on
    CFLIB.org yes but it was not doing the job properly so I did my own
    code to convert the string before passing it to the CFR (as a
    parameter) and as I have only few HTML tags to take car, it was
    done in a matter of 2 minutes.
    Thank you because you make me thing in a new direction!
    <cfparam name="url.TicketID" default="79">
    <cfinclude template="tagStripper.cfm">
    <cfquery name="qGetProblemDescription"
    datasource="#application.DNS#">
    SELECT ProblemDescription
    FROM TICKET
    WHERE TICKETID = #url.TicketID#
    </cfquery>
    <cfset vDescription =
    qGetProblemDescription.ProblemDescription>
    <cfset vDescription = ReplaceList(vDescription,
    "<p>", "")>
    <cfset vDescription = ReplaceList(vDescription,
    "</p>", chr(13))>
    <cfset vDescription = ReplaceList(vDescription,
    "<br>", chr(10))>
    <cfset vDescription = ReplaceList(vDescription,
    "<br/>", chr(10))>
    <cfset vDescription = ReplaceList(vDescription,
    "<hr>", chr(10))>
    <cfset vDescription = ReplaceList(vDescription,
    "</hr>", chr(10))>
    <cfreport template="WorkOrderInformation_en.cfr"
    format="pdf">
    <cfreportparam name="TicketID" value="#url.TicketID#">
    <cfreportparam name="ProblemDescription2"
    value="#vDescription#">
    </cfreport>

  • Getting the value of a html:text property in javascript function

    Hi all,
    I am using struts framework and I need to get a value in a textfield both in java part and javascript part
    <td><html:text property="identityNumber"> </td>
    I dont know how can I reach the value user entered in that field in the javascript function
    function verifyID(){
              var identityUserEntered = ????
    alert(identity);
    }

    the javascript expression document.forms[0].identityNumber.value should do it.
    You do realise you can't run java and javascript at the same time though right? The only way javascript can communicate with java is to submit an http request (normally submit form)

  • Call PDF Javascript Function from External HTML Document

    Greetings,
    Forgive me if this information has been posted previously - I've searched quite a bit and haven't quite found anything specific or similar.
    We have LiveCycle Designed forms, and are including the Form in an IFRAME within an HTML page.  From there, we would like to be able to call one of the functions we've added to the LiveCycle form.
    So for example,
    <HTML>
    <HEAD><TITLE></TITLE>
    <SCRIPT type="text/javascript">
    function CallFunc()
    window.PDFFrame.TestFunc();
    </SCRIPT>
    </HEAD>
    <BODY>
    <iframe src="MyPDFFile.pdf" width="100%" height="100%" name="PDFFrame" id="PDFFrame"></iframe>
    </HTML>
    The "window.PDFFrame.TestFunc()" is where I'm running into issues.  I have tried to use PDFFrame.xfa.etc, and PDFFrame.document.etc, but I'm not sure of the appropriate method to access this PDF Document's functions.
    I do have a "TestFunc()" defined (tested and working) in the PDF document (designed in LiveCycle).
    Any advice is much appreciated -
    Thanks!

    I have attempted to use the information found here for this task:
    http://livedocs.adobe.com/flex/3/html/help.html?content=PDF_1.html
    But is this outdated?  Using the LiveCycle Designer, I have not been able to utilize the "this.hostContainer.messageHandler" with any success.  Is their an equivalent xfa.etc handler?  Or if "this.hostContainer.messageHandler" is still available to Acrobat 9.X documents, what are the appropriate steps to using this?  I've tried putting it in the document initializer, docReady, and Page events and it doesn't seem to be available in any of those.
    Any advice is appreciated,
    Thanks!

  • Can we have javascript function in the HTML header of Page 0

    Hello,
    I want to have a javascript function implemented on page zero, Can anyone help me out with this issue.
    Thanks,
    Orton

    There is no HTML Header on Page Zero. The equivalent would be to use the page template.
    It's also possible to place JavaScript in HTML regions on Page Zero, but I wouldn't consider this a good practice. JavaScript is better kept in external files and referenced using the SRC attribute.

  • Access Java code in Javascript function

    hi all,
    i have a requirement where i need to access a method defined in a plain java class from a javascript function.
    can anyone please let me know, who can i achieve this.
    thanks in advance

    I have a hyperlink in a JSP, onclick of this, i need to perform two tasks:
    (1) the page should be redirected to the same page.
    (2) excute a function which actually defines code to run a perl script.
    so i have wrapped the function in a class and trying to call this function in the javascript function.
    now i am not sure will this work.
    so if there are any other alternatives to achieve this, please share.

Maybe you are looking for

  • How do I get a contact for a complaint!!

    Hi all I'm wondering if anyone can help me at all please. I will post a little background information in the hope that someone with half a brain cell in the bt customer care section actually reads this and responds (yes i am a very unhappy customer r

  • How can i get an old version of iMovie?

    Hello peeps! I have an ibook G4. When I got it it had the iMovie icon on the dashboard but iMovie wouldn't load so i deleted the icon. A friend of mine thought he might be able to sort it out for me but couldn't - he couldn't find iMovie on my machin

  • Restoring 10.7.X after hard drive crash

    My 2007 Macbook had a hard drive crash. I replaced the drive, reinstalled 10.6 (and updates) from the purchased disk, and restored all of the original software. I was previously running 10.7, Lion, but now I am unable to find this on the App Store. I

  • Get rid of fringe which first appears in Adobe Camera Raw

    I use Elements 11.  I have taken a photo of a wharf and done a lot of work on it but now notice that one of the supporting columns has a turquoise fringe right down the side of it.  Looking back at the original RAW file I see that it was there in the

  • Action is not working

    Hi Floks, Regarding BRF, I have created one rule set with two rules and action in CRM 7.0 environment for validation purpose while performing clicking respective event in UI. But this action is not getting executed. Please let me know how to approach