Weird eval() in IE7 - eval

I have the following code:
eval($(this).text());
Now this.text() contains about 50 lines of JS with ''s and ""'s and various JS code.
Now, FireFox, Safari and Chrome have no problem executing this code. However, IE7 reports:
Error: Expected ')' Code: 0
Now, I assume this is some "",'' or (), ie syntax problem... however, I can't reproduce this in smaller code base. Everything I try seems to works in IE7 and FF (& friends).
Any suggestions? Thanks in advance,

Related

karma error "SyntaxError: Expected token 'in'" at js/controllers/batch.js: 9

Googling has turned up a few related issues, but nothing that solved my problem. Line 9 in the js file is empty. If I exclude that file from the tests, I still get error, but at the same line in a different file. Anyone have any idea what might be causing this? This is an angularjs 1.5 project.
Thanks
I was able to figure this out in my own project after using Safari 9 and debugging: we had a template that included a for loop with the "let" keyword used instead of "var". Since templates do not get transpiled, older browsers (depending on which one you're running in Karma) may get tripped up by the newer ES6 style.
For me, it was a line looking like this:
for(let i=0; i<5; i++) {

DNN Skin Issue (VB to C# conversion)

I need assistance with a DNN skin issue. Here's the background.
I have functionality in one of my legacy VB DNN skins that writes the full URL of the parent page. The code is:
<% If PortalSettings.ActiveTab.Level > (0) Then Response.Write(PortalSettings.ActiveTab.BreadCrumbs(PortalSettings.ActiveTab.Level-1).FullUrl) %>
This works fine in my legacy VB skins. However, I am now using a different skin set written in C#. When I apply the above code to the C# skin, it returns the following error message:
Could Not Load Theme: /Portals/_default/Skins/cust08/InteriorSub.ascx,
Error:
c:\inetpub\vhosts\dnnpro.com\httpdocs\Portals_default\Skins\cust08\InteriorSub.ascx(107):
error CS1002: ; expected
I tried tweaking the code, but no success. I'm sure this is an easy fix, but I'm stumped!
Thanks in advance.
The error there is pretty specific You need to put a Semi colon after the code, it is C#
The code you'll likely use would be
<%
If (PortalSettings.ActiveTab.Level >0)
{
Response.Write(PortalSettings.ActiveTab.BreadCrumbs(PortalSettings.ActiveTab.Level-1).FullUrl);
}
%>

Backbone.js, IE 8 and Win 7

Just started to work in backbone.js and asp.net. The code is working fine in Firefox and the same code is not working in IE 8. Do I need to config something to make it work in IE 8?
Console.log works only in Firefox, not sure where to see the logged messsage in IE8 (already using the developer tool of IE 8).
Thanks
In IE 8 you can go to the "Script" tab (you'll see it on the left where there's HTML, CSS, Script, and Profiler tabs) and the console is on the right hand side in that tab.
And the answer to your first question is no, there's nothing special for Backbone.js and IE, you probably have some JavaScript that is perfectly standards compliant and of course, IE 8 doesn't like it.
For example, don't end a list with a trailing comma:
{
"something" : "value",
"other" : "different value",
}
would be fine in Firefox, not-so-much in IE.
Good luck.
I ran into this on my last project. Items like the one mentioned by John can be flagged by running your code through jslint. The trailing comma was my biggest offender
You can use http://www.jslint.com/ and cut down on some of the errors and warning that are not related to running in IE.

IE error with rallyGrid

I'm getting an error with an SDK2.0 app using a rally custom grid:
It only errors with IE (current), and it does not error if I run it locally, only when I install it in Rally and run it.
I don't know if its a Rally issue, or a EXTJS issue.
SCRIPT5007: Unable to get value of the property 'modelField': object is null or undefined
sdk.js, line 4 character 1276692
The code that failed:
if(e.modelField&&e.modelField.hidden)
Context around that error:
{xtype:"rallytextfield",allowBlank:false,removeNameAttribute:true}}},PortfolioItem:function(){return{hidden:true}},AttributeType:function(b){return a.apply(Rally.ui.grid.FieldColumnFactory.defaultRenderer(b),{sortable:false})}})})();(function(){var a=window.Ext4||window.Ext;var b=function(g,e){var d=g.text;var c=e.text;if(d>c){return 1}if(d<c){return -1}return 0};a.define("Rally.ui.grid.ColumnBuilder",{requires:["Ext.Array","Ext.util.Format","Rally.ui.grid.FieldColumnFactory"],constructor:function(){this.defaultColumns=[];this.autoAddAllModelFieldsAsColumns=true},withDefaultColumns:function(c){if(a.isArray(c)){this.defaultColumns=this.defaultColumns.concat(c)}return this},withSortableColumns:function(c){this.sortable=c;return this},shouldAutoAddAllModelFieldsAsColumns:function(c){this.autoAddAllModelFieldsAsColumns=c;return this},build:function(d){var e=a.Array.map(this.defaultColumns,function(g){if(a.isString(g)){return Rally.ui.grid.FieldColumnFactory.getColumnConfigFromField(d.getField(g),this.sortable)}return g},this);if(this.autoAddAllModelFieldsAsColumns){var c=this._buildModelColumns(d,this.defaultColumns,e);e=e.concat(c)}this._removeHiddenColumns(e);return this._stripTagsFromColumnText(e)},_removeHiddenColumns:function(d){for(var c=d.length-1;c>0;c--){var e=d[c];if(e.modelField&&e.modelField.hidden){a.Array.erase(d,c,1)}}}
Not sure what other guidance I can provide to help locate this issue.
The code was a bit large, so I started to do some divide and conquer before I posted it and I found the cause in my code, though probably not the root cause:
In my columnCfgs when adding the rallygrid, I had a trailing ',' on the last entry.
The really annoying thing is this works in all browsers locally, but only fails in IE on Rally with a super obscure error, so its really hard to chase down...even my JavaScript syntax highlighter did not warn me...
I suspect this is actually a problem in either Rally or EXT-JS code where IE is just really finicky...

Getting cell text from a table using Watir on Mac Safari

I've been pulling my hair out trying to figure out why Safari isn't getting cell text from a table.
It seems like this should be working
require 'rubygems'
require 'safariwatir'
#b = Watir::Safari.new
#b.goto(my_webpage)
cell = #b.table(:class, "user-table")[0][1] #getting row 0 cell 1
puts cell.text
I get the error
/Library/Ruby/Gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir/scripter.rb:189:in `find_cell': uninitialized constant Watir::JavaScripter::MissingWayOfFindingObjectException (NameError)
Chrome works just find.
Totally confused!
Thanks for your help.
If you use Watir-Webdriver gem to drive Chrome and Safari it should take care of your problem.
Safariwatir and Watir-Webdriver have similar a API, but not completely identical, as you have noticed. Safariwatir obviously does not support accessing table cells via [].
See this link for details on getting Safari working with Watir-Webdriver

Resources