I created a simple WYSIWYG for creating CSS based webpages. It works exactly as assumed in Safari and Chrome. However, in firefox, when you copy/paste more than one line of text, instead of formatting it as html, in puts in line breaks causing the array storing all of the data to break into multiple lines and causing an unterminated string literal.
1. suggest why it is behaving this way? 2. suggest a work around to allow it to work on FF?
I'm getting an error message come up in IE6 when somenone subscribes to my newsletter from my home page (either from the drop down hover box form or the left hand form) here .
After entering a name and email address I get:
A runtime error has occurred....do you wish to debug? Line 4 Error: Unterminated string constant
When I click NO I then get a second small windows popup which says:
A runtime error has occurred....do you wish to debug? Error: Expected ')'
I've looked at lines 4 and 43 of my thanks.php page (the page subscribers get when they fill out the form but before they double optin via the email) and I can't find anything wrong. I guess the first message expects a semicolon and the second obviously a closing bracket. Code:
<p> Howdy <p> expressed as a literal string that is passed to the setTimeout() function might look like this: setTimeout("document.getElementById('first').innerHTML = '<p>' + 'HOWDY' + '</p>';", 2000);
I guess you can't just put quotes around an expression like this: "'<p> HOWDY </p>;" So tags have to be isolated, but it get confusing with expressions like this, which I am not sure how to express as a string:
I wish I could change the " in there to ' and then just wrap the whole thing in double " This is what I came up with but it did not work: setTimeout("document.getElementById('first').innerHTML = '<p>' + '<h2' + 'class='pos_left'' + '>' + '<img' + 'src='car1.jpg'' + 'name='slide'' + 'width='400'' + 'height='250'' + '/>' + '</h2>' + '</p>';", 4000);
I am trying to create 3 elements on the fly when a button is clicked. The button is the show an upload form for images. I am using uploadify (first time using it) and I have several different upload type/options for them so I am sending id's to differentiate between them. The problem I am having is when trying to create the script tag which in turn controls the input file type tag, and it is baffling me. Here's the code first:
Below I declared a basic object literal with 2 methods. The "doSomething" method is call from the "useDoSomething" method but the call is only sucessful if I use the "this" keyword or qualify the call with "SomeObj".
I have the following code which attaches a function to events in x number of comboboxes (x will probably always = 4, but I do not want to hard-code this). I wish to pass the value of i to the function being attached as well as the value of tempData. In other words, I want the parameters in function to be the value, not a reference variable.
In the current example, I am using the hard-coded variable ci. This I want to be replaced by a literal created when the event handler is attached (the value of the loop variable i). Also, notice that I get the filter value in the event handler (assigned to the variable ct). I would like to replace this code with the value of tempData which would also be determined when the evenet is attached (it is the same value in this case, but it keeps the onChange event from having to do this each time it runs).
Instead of the usual syntax...
The problem is that it's hard for me to adapt procedures which I'm used to within the normal syntax for the literal notation. E.g:
Is this variable global or local? If it's local, how do I declare a variable globally? I also wonder if it is possible to bind events to objects from within the object? And if I'm correct - jQuery is coded this way, but how can they then make use of their selector:
When it is an object defined with literal notation that doesn't have a constructor?
There are two arrays named myContacts and getRes. When I use myContacts array it works fine. When I assign some value for getRes array which is exactly similar format like mycontacts array, but it’s a dynamic value which I already checked no error In the data content. But am facing problem with dynamic value which gave me not same as myContact. tq
Below is a stripped down example of code I'm using to count links in a list. My intent with the ShowLinkNumber() function was to display the number of the current link. (e.g. click on link 2, and the message "2" pops up; click on link 4, and you see a "4.")
For reasons I can't trace, my function always displays the last number in the list. Why does it do this, and can anyone suggest a way to achieve my goal without adding markup? Code:
Can anyone give me some idea of how I make the data coming out of my database translate as literal characters in the XML output?