c# - Call view javascript function from javascript file -


i have jquery template being loaded values after ajax call done , not on view load.

on page load javascript calls , function script.js file. need script.js file call function view. how call listload function script.js

var limit = 5, dir = ' desc', sort = 'created', index = 0, autoscroll = false; function getdataurl(index, action) {      return '/team/linking/listitemlinks/@model.itemid/?type=@model.itemtype';  } function listload() {     alert('test');  } 

corey,

as per understanding, invoke function in js file view , after js file invokes function residing in same view.

i think can achieve (by theoritically) because,

  1. when page loads, clubs js.
  2. consider, if js file points master/layout page , when inner page loads have cumulative js (from page,outside js files , master/layout pages). can call function residing in page js (need verify).

i think jquery may have similar kind of stuffs, because calling jquery using external file, after calls next line.

another thing check callbacks , events in javascript. not expert in topic. can check following links, may helps you. create custom callback in javascript http://blog.pengoworks.com/index.cfm/2012/1/12/adding-custom-callbacks-to-existing-javascript-functions


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -