标签: firebug

ASP.NET MVC控制器操作每个请求执行4次

以前有没有人遇到这样的事情?基本上,我在控制器上有一个动作,它只是通过存储库模式查询数据库,将一些数据添加到ViewData然后返回视图.但由于某种原因,每个请求被调用4次.

整个行动本身只有10行左右:

public ActionResult Details(int id, string slug) {
    Product p = productRepository.GetProduct(id);

    IEnumerable<Image> imgs = productRepository.GetImages(p.ProductId);
    if (imgs.Count() > 0) {
        ViewData["MainImage"] = imgs.First();
        ViewData["Images"] = imgs;
    }

    Brand brand = productRepository.GetBrand(p.ProductId);
    ViewData["Brand"] = brand;

    var categories = productRepository.GetCategories(p.ProductId, true);
    ViewData["ProductCategories"] = categories;

    return View("Details", p);
}
Run Code Online (Sandbox Code Playgroud)

此外,我的Global.asax中定义的路由如下:

routes.MapRoute(
    "SlugsAfterId",
    "{controller}.mvc/{action}/{id}/{slug}",
    new { controller = "Products", action = "Browse", id = "" }
);

// The default route that comes with ASP.NET MVC
routes.MapRoute(
    "Default", …
Run Code Online (Sandbox Code Playgroud)

asp.net asp.net-mvc firebug

2
推荐指数
1
解决办法
773
查看次数

Firefox扩展显示浏览器默认值的继承?

有时候在Firebug中查看计算样式时,不清楚如何计算值或者它的来源是什么.在某些情况下,源是浏览器的默认值.在已经构建的网站中,注入css重置是不可行的,这将导致打破所有页面.

在Firebug,Web Developer或其他扩展中是否有一种方法可以显示继承结构一直到浏览器的默认值,包括显示默认值?

html css firefox firebug firefox-addon

2
推荐指数
1
解决办法
530
查看次数

FirePHP是否受到重定向时Firebug控制台清除的限制?

我在Zend Framework中使用FirePHP.

当用户提交表单时,我希望将一些数据输出到Firebug控制台,FirePHP非常适合这项工作.

这一切似乎都运行良好,除了当我的服务器代码处理表单时,它然后重定向到另一个页面 - 使用Zend的_redirect() - 导致Firebug清除控制台.所以我永远不会看到记录的输出.

如果我阻止重定向,那么我会看到输出(但这不是表单提交的典型工作流程 - 我提交相同的操作,验证和处理,然后重定向到我希望用户最终的位置.)这是一个已建立的Web应用程序.

这有什么解决方法吗?我可能不得不求助于记录到数据库或文件,但Firebug控制台是我正在记录的理想位置.

php firebug zend-framework firephp

2
推荐指数
1
解决办法
1363
查看次数

如何在IE8中观看(即调试)xmlHttpRequest()动作?(使用Firebug Lite)

我通常使用Firefox做我的web开发 - 我通过使用FF和IE定期测试我的页面的跨浏览器兼容性.

我刚刚发现我的一个AJAX页面停止在IE中工作 - 尽管它在FF中工作正常.使用FF,我总是使用FireBug来调试我的Ajax交互.我正在寻找一个与IE一起使用的类似工具 - 看看它导致它失败的原因,即使它在页面上是一个简单的AJAX过程.

我下载了Firebug Lite,这非常有用,因为它为IE带来了熟悉的开发环境.不幸的是,我无法按照ForebugLite的文档调试我的AJAX交互:

firebug.watchXHR: Use this function to watch the status of XmlHttpRequest objects.

    var req = new XmlHttpRequest;
    firebug.watchXHR(req);
Run Code Online (Sandbox Code Playgroud)

我在页面中插入了 - 所以我的页面顶部看起来像这样:

<script type='text/javascript' 
    src='http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'>
    var req = new XmlHttpRequest;
    firebug.watchXHR(req);      
</script>
Run Code Online (Sandbox Code Playgroud)

但是,我仍然无法调试AJAX交互(即当我点击触发AJAX调用的链接时,控制台窗口中没有显示任何内容).

有没有人设法做到这一点(IE7和Firebug Lite)?

ajax firebug internet-explorer-8

2
推荐指数
1
解决办法
2万
查看次数

有没有人知道Firebug等同于Internet Explorer?

问题就是这一切.Inter Explorer缺乏标准的合规性,并且让我陷入了疯狂的边缘.有没有人知道IE8的Firebug等价物?

firebug internet-explorer

2
推荐指数
1
解决办法
5054
查看次数

Firebug控制台缩短了数组中的字符串记录?

我有一个自定义日志记录功能,以登录到firebug控制台,如下所示:

// the name here is just for fun
function ninjaConsoleLog() {
    var slicer = Array.prototype.slice;
    var args = slicer.call(arguments);
    console.log(args);
}
Run Code Online (Sandbox Code Playgroud)

它的工作方式与我想要的完全相同....除非如果我的数组中的字符串值长于大约7个字,则firebug控制台会隐藏字符串值,除了前两个单词和后两个单词.(约)

例:

ninjaConsoleLog("This is a longish string, like the energizer bunny, it just keeps going and going and going.");
Run Code Online (Sandbox Code Playgroud)

上述函数调用导致以下输出到firebug控制台:

["This is a longish strin...going and going."]
Run Code Online (Sandbox Code Playgroud)

这很好,除了有时控制台缩写的字符串部分包含重要数据.

首先,为什么会发生这种情况?

第二,使用我当前的日志记录功能,无论如何我可以强制控制台输出数组中每个项目的完整字符串值吗?或者只是在查看控制台的输出时查看整个字符串?

或者这不可能吗?

谢谢!!

javascript console firebug logging

2
推荐指数
1
解决办法
1314
查看次数

Firebug命中我的调试器语句."继续"做什么以及"禁用"做什么?

如果我点击继续,代码是否在调试器语句后正常执行?如果我点击禁用,调试器语句就会消失.但是代码是如何执行的?它什么都不做?在调试器语句之后它是否正常执行?或者它是从头开始(即刷新)?

javascript firebug

2
推荐指数
1
解决办法
957
查看次数

如何使用firebug在php中查看会话详细信息?

我想知道我怎么能这样做:

console.log('<?php print_r($_SESSION); ?>'); 
Run Code Online (Sandbox Code Playgroud)

在控制台中查看结果.

console.log('<?php echo serialize($_SESSION); ?>');
Run Code Online (Sandbox Code Playgroud)

也不起作用.有没有办法让我在firebug中回显会话信息或检查chrome中的元素以进行测试?

php console session firebug firephp

2
推荐指数
1
解决办法
9437
查看次数

我可以从外部JavaScript访问控制台命令行API(如来自Firebug或Chrome Inspector控制台的$$和traceAll)吗?

是否可以从外部api 访问命令行Api

简单示例:

HTML

  <div id="myDiv"></div>
  <script src="myScript.js"></script>
Run Code Online (Sandbox Code Playgroud)

myScript.js

$$('#myDiv').textContent = 'this will not work';
Run Code Online (Sandbox Code Playgroud)

我不想加载像jQuery或Zepto这样的外部库,因为像这样的seens已经在本地加载了.

javascript api console firebug command

2
推荐指数
1
解决办法
1394
查看次数

Firebug for AngularJS关于ng-options的奇怪错误

当我使用Angular的ng-options时,我得到了这个奇怪的错误:

Error: [ngOptions:iexp] Expected expression in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_' but got 'playlist.id as playlist.name in playlists | orderBy: 'playlist''. Element: <select class="ng-pristine ng-valid" name="playlist" ng-model="playlist" ng-options="playlist.id as playlist.name in playlists | orderBy: 'playlist'">
Run Code Online (Sandbox Code Playgroud)

我的代码是:

<select name="playlist" ng-model="playlist" ng-options="playlist.id as playlist.name in playlists | orderBy: 'playlist'"></select>
<button class="btn btn-branded" ng-click="postSongToPlaylist(playlist.id);">Save</button>
Run Code Online (Sandbox Code Playgroud)

ng-model指的是这个文件:

    MediaService.getPlaylists().then(function (response) {
        $scope.playlists = response.data.data;
    });

    $scope.postSongToPlaylist = function(playlist_id) {
        media = {
            id: $rootScope.song_id
        };
        MediaService.postSongToPlaylist(playlist_id, media).then(function (response) {});
    }
Run Code Online (Sandbox Code Playgroud)

firebug angularjs

2
推荐指数
1
解决办法
1296
查看次数