Menu

Javascript submit being truncated.

2008-08-16
2013-04-24
  • tyler ellis

    tyler ellis - 2008-08-16

    I like the code alot, I am very stoked about it. I am making a very bad javascript post from the editor, it works for a certain amount of characters (greater than 512?1024? no exact number) , or maybe it hangs up on some text from within the box area while being handled by javascript (escaping needed in my code?). For instance, if I copy slashdot's html page, save it with my fckeditor, it saves full longth including html all that. If I open it with my codpress, codepress opens it, codepress receives the whole page, on the javascript submit I only the top part of the page is being recieved by my php post handler. Additionally, I have a seemingly random error, while working within the minimum text constraint only typing short strings like 'hjkhkjfdshkjdsh'  the editor works every time for thirty(really random) times or so times modifing/submiting new, but boom every so often it doesn't work and ajax bombs. My next step is to start troubleshooting from codepress.getCode() w/ strlens and what not to pinpoint exactly where the scripts are truncating the post. I really wish that as a feature codepress would use the value of an input field on the page so that I could post it to my regular html posthandler versus what I am doing right now with xmlhttprequest as I know that works every time and it would confirm/deny that other random error I am having.

    Thanks for the great code.
    Tyler

     
    • tyler ellis

      tyler ellis - 2008-08-17

      & seems to be the issue. It dies on & now. It's not content length related. I will be looking up how to escape & inside of the xmlrequesthttp

       
    • tyler ellis

      tyler ellis - 2008-08-17

      fix it by using escape() on the data I was tyring to send on my script. not sure if more errors will arise as what was said on:
      http://www.albionresearch.com/misc/urlencode.php
      wasn't totally clear on how urlencoding differs from escape()... I may be in for + problems?

       
    • tyler ellis

      tyler ellis - 2008-08-17

      Now if I try to paste a yahoo page, I get javascript. Guess those +'s are a problem.

       
    • tyler ellis

      tyler ellis - 2008-08-17

      Okay after url encoding madness with large pages, I've come to a bug that is in the editor itself. If you goto yahoo.com view source copy all of it, put it in the code editor and the do getCode(), then get its length you'll get 7531 .. The page will be truncated from thier.   Whats in the editor is longer than 7531 (7k). Ironically, if I use fckeditor, save it, then put it through codepress it will load and save and tell me the page is 100k+  in length. No obvious clues as to what fckeditor is changing about the code, but I've seen it parse it a bit and clean it up in the past. The only clue is what I get back from the editor is a javascript portion of the yahoo page. :) 

      Back to that feature request of a postable input/textarea box on the page :)

      Look forward to seeing a fix, love the editor.

       

Log in to post a comment.