Javascript + Php - error message |
Guru master
|
Are you sure it actually parses the PHP? Take a look in the source code. If "short tags" is off then those blocks are left alone.
|
||||||||||||
|
|
sorry should have mentioned these errors are generated within the editor and not when running the script
the script itself works lik a charm, just getting these errors (within the IDE) when editing the file |
||||||||||||
_________________ MV |
|
Since there is now 'Problems' tab in PhpEd this JavaScript error log problem is even bigger.
Here is piece of code:
There shouldn't be any problems at all, but IDE is returning error on every comma and ; Since my pages are full of JavaScripts, I'm getting a lot of errors and I can't concentrate on real one. Please do something about it, or at least tell me how to disable this function for JS in IDE as it is consuming resources but not working well. |
||||||||||||||
|
|
Loading Errors:
These are the equivalent of compile errors in languages such as C++ and Java. Since JavaScript code is an interpreted language, even the most prominent errors won't be caught until the script is loaded in a browser. This type of error, which has the grave effect of halting script execution immediately, can usually be spotted by an error message that refers to some kind of incorrect syntax, such as a missing brace or function parentheses. Runtime Errors: The second type of error occurs when the JavaScript interpreter comes across some code that it can't understand. Again, syntax errors, such as misspelled variable names, may be the culprit. Illegal assignments, such as to the this pointer, will also cause a runtime error. Logic Errors: Errors in processing logic, which can result from misunderstanding the requirements to not drinking enough coffee, are what lead to what developers affectionately refer to as "bugs". A bug can manifest itself as a JavaScript error in any number of ways. Suppose that you wrote a process that expects JSON-formatted data to be returned from the server. Unbeknownst to you, the owner of that application transfers data in XML format. You had better have some thorough error handling in place, or be ready for some strange behavior! |
||||||||||||
|
|
As far as I see the problem has not been solved. But I wanted to update PhpED to 5,9. But now I see, that I have to stay working in 5,6...
|
||||||||||||
|
|
Yep, problem still exists in 5919.
It shows it's ugly head both in file and in Problems window. Annoying little bugger. |
||||||||||||
|
Site Admin
|
This is not a bug at all. It works as intended. IDE can't capture any valid js code from your script without executing it, but execution is not what you want, I guess. Without executing php, your code looks like PromotionLimit = ; if ( count + > PromotionLimit && PromotionLimit < 0 ) I can think of two possible solutions: 1) Stop usisng code mixture. Either JS or PHP. Don't use them together. It would improve everything, including code maintainability, and performance. With php code in, your js files can not be cached at the client side, so they will be re-requested for all pages referring to the script. 2) Do not share any single statement between the languages. Either all the statement in php or in js. For example you can write <? echo "PromotionLimit = $PromotionLimit" ?>; instead of PromotionLimit = <?=$PromotionLimit?>; |
||||||||||||||
_________________ The PHP IDE team |
|
So, if it's not bug, than it's a feature. Just kidding
Anyway thnx for explaining all this Dimitri, it is a valuable insight how things should be setup in PhpEd. I liked this last option as it will not violate code and maintain dynamic setup of JS vars, what was main point from the start. But I still think that this will continue to be somewhat problem, as many times these days, JS is getting all variables directly from php. |
||||||||||||
|
|
OK, so I've managed to clear JS errors, but what about CSS errors?
Do I have to live with errors in:
and
or can I fix these as well? |
||||||||||||||||
|
Site Admin
|
Regarding CSS PhpED v5.x supports CSS 2.1 standard syntax only.
|
||||||||||||
_________________ The PHP IDE team |
Veteran
|
There are cases where I want adjust the JS to a particular situation, and mixing in PHP code is very convenient. I understand that this is a complex issue Dmitri, but I am "sure" you can find a way around this, e.g. ignore <?php ?> tags when evaluating JS.
Thank you, this seems a workable solution for now. I still have a strong preference to continue doing it the way MacVato has it in the first post. |
||||||||||||||||
_________________ |
Javascript + Php - error message |
|
||
Content © NuSphere Corp., PHP IDE team
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by