迁移到客户端,ASP.NET上的jQuery

时间:2021-10-20 15:11:54

I'm building some simple web apps and using jQuery to call .net webmethods.

我正在构建一些简单的Web应用程序并使用jQuery来调用.net webmethods。

The more I put together, the more I wonder where I draw the line between the aspx page and what I can produce with jQuery/jTemplate and a few ajax calls. It seems I can do everything on the client now, and easily too. At the moment I've just got one default.htm that does everything.

我把它放在一起越多,我就越想知道我在aspx页面和我用jQuery / jTemplate和一些ajax调用生成的内容之间的界限。看来我现在可以在客户端上做所有事情,也很容易。目前我只有一个default.htm可以完成所有工作。

So, it would be great to know what problems you think I'll come across if I continue with this choice of architecture. What are the strengths of server-generated pages? Should I go all out client or all out server? It seems mixing the two might be worse of both worlds.

所以,如果我继续选择这种架构,那么知道你认为我会遇到什么问题会很棒。服务器生成的页面有哪些优势?我应该全力以赴客户端还是全部服务器?似乎混合两者可能两个世界都更糟糕。

2 个解决方案

#1


Some concerns with your approach so far:

到目前为止,您对方法的一些担忧:

  • If your user turns off JavaScript, they can't use the site.
  • 如果您的用户关闭了JavaScript,则他们无法使用该网站。

  • Your user will have a hard-time bookmarking things.
  • 您的用户将有一些困难的书签。

  • You risk putting too much code in one place, making it very hard to maintain
  • 您可能会在一个地方放置太多代码,这使得维护非常困难

  • Controlling security could be more difficult and complicated
  • 控制安全性可能更加困难和复杂

#2


Be careful doing JS only pages, as Google Bots tend to not see content generated by AJAX. I have always done a good mix, where the page has a great amount of content the Search Engines can digest wile using the JS/Ajaxy stuff to wow the humans...

小心只做JS页面,因为Google Bots往往看不到AJAX生成的内容。我总是做了很好的混合,其中页面有大量的内容,搜索引擎可以使用JS / Ajaxy的东西消化诡计让人类惊叹......

#1


Some concerns with your approach so far:

到目前为止,您对方法的一些担忧:

  • If your user turns off JavaScript, they can't use the site.
  • 如果您的用户关闭了JavaScript,则他们无法使用该网站。

  • Your user will have a hard-time bookmarking things.
  • 您的用户将有一些困难的书签。

  • You risk putting too much code in one place, making it very hard to maintain
  • 您可能会在一个地方放置太多代码,这使得维护非常困难

  • Controlling security could be more difficult and complicated
  • 控制安全性可能更加困难和复杂

#2


Be careful doing JS only pages, as Google Bots tend to not see content generated by AJAX. I have always done a good mix, where the page has a great amount of content the Search Engines can digest wile using the JS/Ajaxy stuff to wow the humans...

小心只做JS页面,因为Google Bots往往看不到AJAX生成的内容。我总是做了很好的混合,其中页面有大量的内容,搜索引擎可以使用JS / Ajaxy的东西消化诡计让人类惊叹......